Open AntoineTurmel opened 9 years ago
I assume this is intended because the bot actually doesn't listen for "leaving a channel" (PART
) event, instead it listens for the QUIT
event, which doesn't reference a specific channel because the user disconnects from the IRC server completely.
It's not possible to write a quit line for each channel where the user was ?
No, not really, as you can see here, the bot tries to parse the channel if the event contains one. However if the user quits instead of parts the channel, the bot won't be able to tell which channels the person was participating.
Perhaps someone else has an idea how to solve this. I'm not a Python pro at all.
Well the bot can determine the quit is from X channel because the quit message is displayed on the channel no ?
I don't think that's how the IRC library works. In general it receives events, those can be messages, join events, quit events, topic change events, etc. At the moment, pierc just receives those and writes it's information into the database. However, the quit
event doesn't contain a channel or target which we can parse. At this point we don't know "where" the quit came from.
Ok, so I suppose we need first to detect if an user is in the channel... and then deduce by the quit that he is no more in the channel.
When a user quit the channel, it does not store the channel in the main table. "undefined" is put instead of the right channel name: