diff options
Diffstat (limited to 'plugins/marquee.py')
-rw-r--r-- | plugins/marquee.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/plugins/marquee.py b/plugins/marquee.py index 80bfbfeb..66ec8b70 100644 --- a/plugins/marquee.py +++ b/plugins/marquee.py @@ -34,6 +34,7 @@ Configuration """ +import asyncio from poezio.plugin import BasePlugin from poezio import tabs from poezio import xhtml @@ -41,7 +42,7 @@ from poezio.decorators import command_args_parser def move(text, step, spacing): - new_text = text + (" " * spacing) + new_text = text + ("\u00A0" * spacing) return new_text[-(step % len(new_text)):] + new_text[:-( step % len(new_text))] @@ -62,10 +63,12 @@ class Plugin(BasePlugin): 'Replicate the <marquee/> behavior in a message') @command_args_parser.raw - def command_marquee(self, args): + async def command_marquee(self, args): + if not args: + return None tab = self.api.current_tab() args = xhtml.clean_text(xhtml.convert_simple_to_full_colors(args)) - tab.command_say(args) + await tab.command_say(args) is_muctab = isinstance(tab, tabs.MucTab) msg_id = tab.last_sent_message["id"] jid = tab.jid @@ -85,6 +88,6 @@ class Plugin(BasePlugin): message.send() event = self.api.create_delayed_event( self.config.get("refresh"), self.delayed_event, jid, body, - message["id"], step + 1, duration + self.config.get("refresh"), + msg_id, step + 1, duration + self.config.get("refresh"), is_muctab) self.api.add_timed_event(event) |