2016-06-27 23:10:52 +00:00
|
|
|
from poezio.plugin import BasePlugin
|
|
|
|
from poezio import tabs
|
2011-09-24 20:26:31 +00:00
|
|
|
|
2018-08-15 11:13:17 +00:00
|
|
|
|
2011-09-23 15:43:01 +00:00
|
|
|
class Plugin(BasePlugin):
|
|
|
|
def init(self):
|
2018-08-15 11:13:17 +00:00
|
|
|
self.api.add_command('plugintest', self.command_plugintest,
|
|
|
|
'Test command')
|
|
|
|
self.api.add_tab_command(tabs.MucTab, 'plugintest',
|
|
|
|
self.command_tab_plugintest, 'Test command')
|
2016-03-08 22:02:01 +00:00
|
|
|
self.api.add_slix_event_handler('message', self.on_message)
|
2013-03-08 21:53:35 +00:00
|
|
|
self.api.information("Plugin loaded")
|
2011-09-23 15:43:01 +00:00
|
|
|
|
|
|
|
def cleanup(self):
|
2013-03-08 21:53:35 +00:00
|
|
|
self.api.information("Plugin unloaded")
|
2011-09-23 15:43:01 +00:00
|
|
|
|
|
|
|
def on_message(self, message):
|
2018-08-15 11:13:17 +00:00
|
|
|
self.api.information(
|
|
|
|
"Test plugin received message: {}".format(message))
|
2011-09-23 15:43:01 +00:00
|
|
|
|
2011-11-12 23:26:14 +00:00
|
|
|
def command_tab_plugintest(self, args):
|
2013-03-08 21:53:35 +00:00
|
|
|
self.api.information("Command for MucTabs! With args {}".format(args))
|
|
|
|
self.api.del_tab_command(tabs.MucTab, 'plugintest')
|
2011-11-12 23:26:14 +00:00
|
|
|
|
2011-09-23 15:43:01 +00:00
|
|
|
def command_plugintest(self, args):
|
2013-03-08 21:53:35 +00:00
|
|
|
self.api.information("Command! With args {}".format(args))
|