poezio/plugins/status.py

14 lines
513 B
Python
Raw Normal View History

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):
for st in ('dnd', 'busy', 'afk', 'chat', 'xa', 'away', 'available'):
self.api.add_command(st,
2013-03-10 21:59:21 +00:00
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)