poezio/plugins/status.py

44 lines
901 B
Python
Raw Permalink Normal View History

"""
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``
"""
from poezio.plugin import BasePlugin
2011-10-29 15:47:30 +00:00
2018-08-15 11:13:17 +00:00
2011-10-29 15:47:30 +00:00
class Plugin(BasePlugin):
"""
Adds several convenient aliases to /status command
"""
2018-08-15 11:13:17 +00:00
2011-10-29 15:47:30 +00:00
def init(self):
for st in ('dnd', 'busy', 'afk', 'chat', 'xa', 'away', 'available'):
2018-08-15 11:13:17 +00:00
self.api.add_command(
st,
lambda line, st=st: self.api.run_command('/status ' + st + ' "' + line + '"'),
usage='[status message]',
short='Set your status as %s' % st,
help='Set your status as %s' % st)