johnmaguire / Cardinal

A Python IRC bot, designed to make adding functionality quick and simple. (est. 2013)
MIT License
100 stars 38 forks source link

Add 'seen' plugin #173

Closed jsmailes closed 3 years ago

jsmailes commented 3 years ago

Adds the 'seen' plugin which adds the command .seen <user> (with alias .lastseen <user>).

The plugin tracks whenever a user interacts in a channel Cardinal is in, logging their most recent action and when it occurred. Other users can then look up when the user was last active.

This tracking does not persist across reboots of the bot or reloads of the plugin.

The plugin tracks the following events:

johnmaguire commented 3 years ago

Hey thanks, this looks great and fulfills #170. Sorry I missed it earlier. I'll test this out and merge it soon.

johnmaguire commented 3 years ago

This looks great as a first pass! I did have one comment I'd like to see addressed. Separately, I wondered if you would be willing to add a small amount of code to persist this data across Cardinal reboots using a lightweight database method that was recently added. I wrote up a quick wiki page on it: https://github.com/JohnMaguire/Cardinal/wiki/Database-Access

johnmaguire commented 3 years ago

I updated this to use a persistent DB, which you can see here: https://github.com/JohnMaguire/Cardinal/tree/seen-plugin

I haven't taken the time yet to actually test out each of these event handlers though, so am not merging to master quite yet. If anyone else wants to take a crack at testing it, that'd be awesome!

johnmaguire commented 3 years ago

Alright - all merged. Enabled it by default in 19191f973cbea1b2001f6812f9b4004d777c6b03. Thanks again for the pull request!