X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;f=sid%2Fecho.py;h=5bb90c06768e7e5daaf9e99b6721ef8d3a352784;hb=382e54a3933a477e70af74eb6af45c9ad4c669a3;hp=534163c378c95df65e0ad888786c4c5481ccbf29;hpb=8d02f7db31a8587f1cd9bb31bcdffd517f6c144e;p=sid.git diff --git a/sid/echo.py b/sid/echo.py index 534163c..5bb90c0 100644 --- a/sid/echo.py +++ b/sid/echo.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Copyright (C) 2007-2012 Thomas Perl -# Copyright (C) 2014 kaliko +# Copyright (C) 2014, 2020 kaliko # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,8 +17,9 @@ from .plugin import Plugin, botcmd + class Echo(Plugin): - """Drop a message to be sent when someone gets online. + """Drops a message to be sent when someone gets online. """ def __init__(self, bot): @@ -30,10 +31,11 @@ class Echo(Plugin): # any presences you send yourself. To limit event handling # to a single room, use the events muc::room@server::presence, # muc::room@server::got_online, or muc::room@server::got_offline. - bot.add_event_handler("muc::%s::presence" % self.bot.room, self.log_presence) + bot.add_event_handler("muc::%s::presence" % + self.bot.room, self.log_presence) def log_presence(self, pres): - """Register presence""" + """Handler method registering MUC participants presence""" self.log.debug('%s: %s', pres['muc']['nick'], pres['type']) nick = pres['muc']['nick'] self.presence.update({nick: (pres['muc']['role'], pres['type'])}) @@ -43,13 +45,15 @@ class Echo(Plugin): self.send(self.bot.room, self.inbox.get(nick).pop(), mtype='groupchat') - self.inbox.pop(nick) + self.inbox.pop(nick) @botcmd def tell(self, message, args): - """drop a message to be sent when someone gets online. - !tell queue : messages in queue - !tell : append to in queue""" + """ + **commands**: + + * ``!tell queue`` : messages in queue + * ``!tell `` : append to in queue""" if not len(args): msg = 'Missing arguments:\n{}'.format(self.tell.__doc__) self.reply(message, msg)