Fix command parsing
This commit is contained in:
parent
9c830e4f6c
commit
f593db112c
3 changed files with 4 additions and 4 deletions
src/ovtk_audiencekit/plugins
|
@ -87,7 +87,7 @@ class JailPlugin(PluginBase):
|
|||
if isinstance(event, Message):
|
||||
if self.jail_command.invoked(event):
|
||||
try:
|
||||
args = self.jail_command.parse(event.text)
|
||||
args, _ = self.jail_command.parse(event.text)
|
||||
end_date = maya.when(args['length'], prefer_dates_from='future')
|
||||
deets = self.chats[event.via].shared.api.get_user_details(args['username'])
|
||||
if deets is None:
|
||||
|
@ -117,7 +117,7 @@ class JailPlugin(PluginBase):
|
|||
self.send_to_bus(weewoo)
|
||||
elif self.unjail_command.invoked(event):
|
||||
try:
|
||||
args = self.jail_command.parse(event.text)
|
||||
args, _ = self.jail_command.parse(event.text)
|
||||
deets = self.chats[event.via].shared.api.get_user_details(args['username'])
|
||||
if deets is None:
|
||||
raise ValueError()
|
||||
|
|
|
@ -47,7 +47,7 @@ class ShoutoutPlugin(PluginBase):
|
|||
if isinstance(event, Message):
|
||||
if self.command and self.command.invoked(event):
|
||||
try:
|
||||
args = self.command.parse(event.text)
|
||||
args, _ = self.command.parse(event.text)
|
||||
except ArgumentError as e:
|
||||
msg = SysMessage(self._name, str(e), replies_to=event)
|
||||
self.chats[event.via].send(msg)
|
||||
|
|
|
@ -139,7 +139,7 @@ class CommandPlugin(PluginBase):
|
|||
|
||||
if self.help_cmd.invoked(event):
|
||||
try:
|
||||
args = self.help_cmd.parse(event.text)
|
||||
args, _ = self.help_cmd.parse(event.text)
|
||||
except argparse.ArgumentError as e:
|
||||
msg = SysMessage(self._name, f"{e}. See !help {self.help_cmd.name}", replies_to=event)
|
||||
self.chats[event.via].send(msg)
|
||||
|
|
Loading…
Add table
Reference in a new issue