Skip to content

Commit

Permalink
Stop bot showing as "typing" response to every message
Browse files Browse the repository at this point in the history
  • Loading branch information
allc committed Nov 28, 2024
1 parent de8059d commit f2eeb74
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,12 @@ async def on_message(message: discord.Message):
if message.author == bot.user:
return

await message.channel.trigger_typing()

try:
# Check if the message is a status check via a very simple:tm: regex
# thx regex101.com
if re.match(r"^(is +)?(my *ed|learn|[\/&\+])* +down( |\?|$)", message.content, re.IGNORECASE | re.MULTILINE):
await message.channel.trigger_typing()

# check if myed is down
try:
response = requests.get("https://www.myed.ed.ac.uk/myed-progressive/", timeout=5)
Expand Down

0 comments on commit f2eeb74

Please sign in to comment.