2013-04-13 20:33:06 +00:00
|
|
|
"""
|
|
|
|
This plugin adds several aliases, to shorten status changes.
|
|
|
|
|
|
|
|
Aliases
|
|
|
|
-------
|
|
|
|
|
|
|
|
.. glossary::
|
|
|
|
:sorted:
|
|
|
|
|
|
|
|
/afk
|
|
|
|
/away
|
|
|
|
Set your status to ``away``
|
|
|
|
|
|
|
|
/dnd
|
|
|
|
/busy
|
|
|
|
Set your status to ``dnd``
|
|
|
|
|
|
|
|
/available
|
|
|
|
Set your status to ``available``
|
|
|
|
|
|
|
|
/chat
|
|
|
|
Set your status to ``chat``
|
|
|
|
|
|
|
|
/xa
|
|
|
|
Set your status to ``xa``
|
|
|
|
|
|
|
|
"""
|
2011-10-29 15:47:30 +00:00
|
|
|
from plugin import BasePlugin
|
|
|
|
|
|
|
|
class Plugin(BasePlugin):
|
|
|
|
"""
|
|
|
|
Adds several convenient aliases to /status command
|
|
|
|
"""
|
|
|
|
def init(self):
|
2013-03-01 18:25:31 +00:00
|
|
|
for st in ('dnd', 'busy', 'afk', 'chat', 'xa', 'away', 'available'):
|
2013-03-08 21:53:35 +00:00
|
|
|
self.api.add_command(st,
|
2013-03-10 21:59:21 +00:00
|
|
|
lambda line,st=st: self.api.run_command('/status ' + st + ' "'+line+'"'),
|
2013-03-01 18:25:31 +00:00
|
|
|
usage='[status message]',
|
|
|
|
short='Set your status as %s' % st,
|
|
|
|
help='Set your status as %s' % st)
|