Mirror of the Rel4tion website/wiki source, view at <http://rel4tion.org>
Clone
HTTPS:
git clone https://vervis.peers.community/repos/yEzqv
SSH:
git clone USERNAME@vervis.peers.community:yEzqv
Branches
Tags
5.mdwn
[[!template id=ticket class=task assigned=fr33domlover done=yes]] [[!tag /projects/funbot/ideas]]
[[!meta title=“Detect which users are online”]]
[[!template id=ticket-depends-on proj=irc-fun-messages n=1]] (reply analysis support)
Issue
When sending a message for a user, the bot should be able to check if the user is online, and keep it for later if not. So two things are useful:
- Get a list of users in a channel
- Check if a given user is online
Perhaps tracking JOINs/PARTs can help. Or perhaps there are better ways.
Various features can then be built on top of this functionality.
Process
I went over the IRC command list in Wikipedia, and I found the following ways to track users in a channel and online users in general:
- When JOINing a channel, part of the reply lists the users in it
- Every JOIN and PART in the joined channels is received by the bot
- The NAMES command lists the members of one or more channels
- The ISON command checks which users from a given user list are online
–[[fr33domlover]]
Result
ISON isn’t implemented currently, but managing user lists works as follows:
- There’s a user list per channel in the bot state (yeah, it isn’t empty anymore)
- Joining a channel triggers
NAMREPLY
from the server, which is parsed into theNames
bot event, whose handler gets the channel’s list filled - JOINs, PARTs and QUITs trigger list updates
–[[fr33domlover]]