Fix bug when commands with no params are given a param

master
DustyP 6 years ago
parent 2abee4572d
commit a150bdd027

@ -70,7 +70,7 @@ class Command:
args = [] args = []
kwargs = {} kwargs = {}
if args_list: if args_list:
params = self.parser.parse_args(args_list) params, ctx.extra_params = self.parser.parse_known_args(args_list)
for key, value in iterator: for key, value in iterator:
value: inspect.Parameter value: inspect.Parameter

@ -14,6 +14,7 @@ class Context:
self.content: ContentBase = content self.content: ContentBase = content
self.called_with: str = called_with self.called_with: str = called_with
self.body: str = body self.body: str = body
self.extra_params: list = []
async def send_text(self, body: str, formatted_body: str = None, format_type: str = 'org.matrix.custom.html'): async def send_text(self, body: str, formatted_body: str = None, format_type: str = 'org.matrix.custom.html'):
await self.client.send_text(self.room, body, formatted_body, format_type) await self.client.send_text(self.room, body, formatted_body, format_type)

Loading…
Cancel
Save