This allows plugins to specify the types of messages they handle. This
will be used specifically for the nickserv plugin, but could be useful
for other things too.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
When a user's name is used in the !wordbot leaderboard command, we make
every effort to not ping them by interleaving zero-width space
characters in the nickname.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This matches the old database format that was written a while back.
There's an "end_now" command that's been left in there for debugging
purposes, that'll be gone soon enough.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
Plugins now use Bots instead of server_configs, this is useful for
checking the currently joined channels and perhaps using the connection
when there isn't one available in the current method.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
* .items() call required when loading a markov chain into memory
* `who.nick` instead of `who~ for get_chain call
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
* on_connect is called on all plugins on the first message received from
the IRC server
* joined_channels property gets all of the channels that this bot has
currently joined in IRC
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This will just send a message to the user who just updated their markov
reply chance with the final value it was set to, so there are no
surprises.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
Whenever someone says something, there's a chance that markov will
interject his opinion. Users can also set the chance between 0.0 and the
default value (in the config) if they want to see markov replies less
often.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
If something is changed in a markov chain it gets flagged as dirty,
which is used to determine whether the chain should be saved.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
If you don't use/access your chain every N seconds (300 by default), it
will unload your chain from memory and save it to disk.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This sets up a set of ropes and pulleys that signal the `Bot.keepalive`
function to clean things up after a quit signal has been sent. This
allows plugins to define an `on_unload` function to save any important
datas on intentional exit.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This is beneficial for all plugins so the bot doesn't accidentally
spam things because the plugin writer didn't check their inputs
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
For some reason, async-timeout needs to be specifically marked as >=4
when using the aiohttp package.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
aiohttp has a weird issue when installing with pipenv. A workaround is
added in the README.md to at least cover that case when it comes time to
deploy on a real server.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>