Skip to content

Commit

Permalink
Merge pull request #4 from compsoc-edinburgh/bot-less-typing
Browse files Browse the repository at this point in the history
Make bot to "typing" less
  • Loading branch information
yutotakano authored Nov 28, 2024
2 parents de8059d + f2eeb74 commit 3f79a17
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 3f79a17

Please sign in to comment.