So after reading a bit and reading your code, I think I cannot do what I mean.

With your code, what I get is first 3 lines of names command everytime I invoke /names command.

What I wanted is to create a command (or alias) with which I get first 3 lines of names of each channel is input as argument of that command, but all the users are output if the normal /names command is used.

I don't know if inside a alias (or a command) I can set a flag variable that I can read inside a raw event to decide wether to output all the lines of names or only the first 3 ...