Skip to content

Commit

Permalink
reacts when 臺灣/台灣 is mentioned
Browse files Browse the repository at this point in the history
  • Loading branch information
chanomkaimuk committed Aug 10, 2023
1 parent ea63309 commit 26be6e6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions commands/reacttw/react_tw.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
)


def is_TW_message(message: discord.Message):
return (
("TAIWAN" in message.content.upper())
or ("台灣" in message.content)
or ("臺灣" in message.content)
)


def mock_bernoulli(p: float) -> bool:
"""Returns True with probability.
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ async def on_message(message: discord.Message):
if message.author == client.user:
return

if "TAIWAN" in message.content.upper():
if react_tw.is_TW_message(message):
await react_tw.send_react_tw(message)


Expand Down

0 comments on commit 26be6e6

Please sign in to comment.