-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
See who is present on the channel #29
Comments
That's quite a bit of work to implement in core, as the client would have to keep track of all the joins, parts, quits, bans, and kicks after joining the channel. One of the alternative methods is to use So it'd be Successful responses will be sent in
Sample from my local server:
so it'd be something like:
|
/o\ |
I've added a working example: https://github.com/zoffixznet/perl6-IRC-Client/blob/master/examples/08-numeric-bot.p6 This won't be core feature, but a plugin (that may be shipped with a core distro). The core (if required) needs to provide all of the facilities that would make it possible for other plugins to interface with the names tracking and run queries on it. |
Yeah. I did it already: https://github.com/perl6/whateverable/blob/master/Evalable.p6#L109. But of course, I wish I did not have that stuff in the code. Not sure why it can't be in core, but whatever. Your house, your rules :) |
If you want to maintain a list of everyone who is on a particular channel, you will need to keep track of people joining, changing nicks, and leaving the channel. Considering how some channels have absurd numbers of people on them, it might be more desirable to provide an interface that lets the plugin's user specify a list of nicks to keep track of, and the bot will then pay attention to whether or not those nicks are present/absent on whichever channels the bot is on. In this case, the bot would not need to issue a NAMES command, but rather a WHOIS command for each monitored nick, and parse the RPL_WHOISCHANNELS part of each reply. After that, it would still need to pay attention to JOIN, PART, and NICK messages, but only ones which involve the particular nicks. For example, the Evalable bot only cares whether camelia is present on #perl6, and shouldn't need a full list of #perl6's users. Similarly, the Unicodable bot only cares about whether yoleaux or yoleaux2 is present. |
@BenGoldberg1, that's an interesting idea! |
I was expecting IRC::Client to provide something like
$message.channel.people
, so that I can see who is on the channel.I thought about other ways of achieving that, but all of them are quite painful.
Any ideas?
The text was updated successfully, but these errors were encountered: