Skip to content

Commit

Permalink
fix args check error
Browse files Browse the repository at this point in the history
  • Loading branch information
a3510377 committed Feb 1, 2024
1 parent ae8f5a4 commit e00cc12
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions plugins/discord/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,9 @@ async def on_message(self, msg: Message):
(key := msg.content) in canned_message
and msg.channel.id
not in (self.config.get("black_canned_message_channel", {})).get(key, [])
and msg.channel.parent_id
not in (self.config.get("black_canned_message_parent", {})).get(key, [])
and msg.channel.category_id
and msg.channel.category_id
not in (self.config.get("black_canned_message_category", {})).get(key, [])
):
await msg.channel.send(
random.choice(value)
Expand Down
2 changes: 1 addition & 1 deletion plugins/discord/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class DiscordConfig(Config):
online_icon_url = "AUTO"
canned_message: dict[str, str | list[str]] = {}
black_canned_message_channel: dict[str, list[int]] = {}
black_canned_message_parent: dict[str, list[int]] = {}
black_canned_message_category: dict[str, list[int]] = {}


class Discord(Plugin, config=DiscordConfig):
Expand Down

0 comments on commit e00cc12

Please sign in to comment.