plugins/marquee: Ensure a message is sent before correcting

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2022-03-29 15:54:51 +02:00
parent 4f9e734a7f
commit 1322c2b1c8
Signed by: pep
GPG key ID: DEDA74AEECA9D0F2

View file

@ -63,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))
asyncio.ensure_future(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