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):
|
async def send_text(self, room: Room, body: str, formatted_body: str = None, format_type: str = None):
|
||||||
content = {
|
content = {
|
||||||
'msgtype': 'm.text',
|
'msgtype': 'm.notice',
|
||||||
'body': body
|
'body': body
|
||||||
}
|
}
|
||||||
if formatted_body and format_type:
|
if formatted_body and format_type:
|
||||||
|
|||||||
@ -68,6 +68,9 @@ class Bot(Client):
|
|||||||
return Context.get_context(event, prefix, called_with, body)
|
return Context.get_context(event, prefix, called_with, body)
|
||||||
|
|
||||||
async def process_command(self, event):
|
async def process_command(self, event):
|
||||||
|
if not event.content.msgtype == 'm.text':
|
||||||
|
return
|
||||||
|
|
||||||
ctx = await self.get_context(event)
|
ctx = await self.get_context(event)
|
||||||
if not ctx:
|
if not ctx:
|
||||||
return
|
return
|
||||||
|
|||||||
@ -78,7 +78,6 @@ class Command:
|
|||||||
args.extend(params.__dict__[key])
|
args.extend(params.__dict__[key])
|
||||||
else:
|
else:
|
||||||
kwargs[key] = params.__dict__[key]
|
kwargs[key] = params.__dict__[key]
|
||||||
|
|
||||||
await self.function(ctx, *args, **kwargs)
|
await self.function(ctx, *args, **kwargs)
|
||||||
else:
|
else:
|
||||||
await self.function(ctx)
|
await self.function(ctx)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user