diff options
author | mathieui <mathieui@mathieui.net> | 2021-01-30 13:59:42 +0100 |
---|---|---|
committer | Link Mauve <linkmauve@linkmauve.fr> | 2021-02-03 15:22:09 +0100 |
commit | 46d90bf8324e4612cbe2aee2e7eeb441ed1a2617 (patch) | |
tree | 6a9a3f9a770ce14b9fe4746867e96eb93890b00f /plugins/disco.py | |
parent | e2224b938bc2a56053d59fa9671c5b77d1fc1b05 (diff) | |
download | poezio-46d90bf8324e4612cbe2aee2e7eeb441ed1a2617.tar.gz poezio-46d90bf8324e4612cbe2aee2e7eeb441ed1a2617.tar.bz2 poezio-46d90bf8324e4612cbe2aee2e7eeb441ed1a2617.tar.xz poezio-46d90bf8324e4612cbe2aee2e7eeb441ed1a2617.zip |
plugins: remove callbacks
Diffstat (limited to 'plugins/disco.py')
-rw-r--r-- | plugins/disco.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/plugins/disco.py b/plugins/disco.py index 368b35d8..52963d39 100644 --- a/plugins/disco.py +++ b/plugins/disco.py @@ -73,7 +73,7 @@ class Plugin(BasePlugin): self.api.information('\n'.join(describe(item) for item in items['items']), 'Items') @command_args_parser.quoted(1, 3) - def command_disco(self, args): + async def command_disco(self, args): if args is None: self.core.command.help('disco') return @@ -88,10 +88,14 @@ class Plugin(BasePlugin): jid, node, type_ = args try: if type_ == 'info': - self.core.xmpp.plugin['xep_0030'].get_info( - jid=jid, node=node, cached=False, callback=self.on_info) + iq = await self.core.xmpp.plugin['xep_0030'].get_info( + jid=jid, node=node, cached=False + ) + self.on_info(iq) elif type_ == 'items': - self.core.xmpp.plugin['xep_0030'].get_items( - jid=jid, node=node, cached=False, callback=self.on_items) + iq = await self.core.xmpp.plugin['xep_0030'].get_items( + jid=jid, node=node, cached=False + ) + self.on_items(iq) except InvalidJID as e: self.api.information('Invalid JID ā%sā: %s' % (jid, e), 'Error') |