Search code examples
commandresponseirc

Get IRC Command response


I want to run an IRC Command, and get the response for it for bots.

Is there any way to do this?

for example, I want to get the result of "NAMES #channel" or "WHO #channel u"


Solution

  • You have to wait for 353 and 366 replies (for NAMES), and 354 and 315 for WHO.

    For instance, when using NAMES:

    (outgoing) NAMES #channel
    (incoming) :wilhelm.freenode.net 353 botnick = #channel :user1 user2 user3 @user4
    (incoming) :wilhelm.freenode.net 366 botnick #channel :End of /NAMES list.
    

    And similarily when using WHO:

    (outgoing) WHO #channel
    (incoming) :wilhelm.freenode.net 354 botnick #channel ident host sendak.freenode.net nick H 0 nick :realname
    […]
    (incoming) :wilhelm.freenode.net 315 botnick #channel :End of /WHO list.