Change bot commands to not process m.notice
Change bot to send m.notice instead of m.text
This commit is contained in:
parent
a150bdd027
commit
4203f87f3d
@ -192,7 +192,7 @@ class Client:
|
||||
|
||||
async def send_text(self, room: Room, body: str, formatted_body: str = None, format_type: str = None):
|
||||
content = {
|
||||
'msgtype': 'm.text',
|
||||
'msgtype': 'm.notice',
|
||||
'body': body
|
||||
}
|
||||
if formatted_body and format_type:
|
||||
|
||||
@ -68,6 +68,9 @@ class Bot(Client):
|
||||
return Context.get_context(event, prefix, called_with, body)
|
||||
|
||||
async def process_command(self, event):
|
||||
if not event.content.msgtype == 'm.text':
|
||||
return
|
||||
|
||||
ctx = await self.get_context(event)
|
||||
if not ctx:
|
||||
return
|
||||
|
||||
@ -78,7 +78,6 @@ class Command:
|
||||
args.extend(params.__dict__[key])
|
||||
else:
|
||||
kwargs[key] = params.__dict__[key]
|
||||
|
||||
await self.function(ctx, *args, **kwargs)
|
||||
else:
|
||||
await self.function(ctx)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user