Skip to content

Commit

Permalink
respond to dm with canned message
Browse files Browse the repository at this point in the history
  • Loading branch information
dariagrudzien committed Aug 2, 2023
1 parent 3bdfa24 commit bffddde
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions juniorguru_chick/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ async def on_message(message: discord.Message) -> None:
logger.info("Message sent by the bot itself, skipping")
return
if message.guild is None:
try:
response = "Píp píp píp! Jsem jen malé kuřátko, které neumí číst soukromé zprávy a odpovídat na ně.\
Tvou zprávu si nikdo nepřečte. Pokud se chceš na něco zeptat, zkus kanál <#769966886598737931>\
nebo napiš do soukromé zprávy komukoliv z moderátorů. Rádi tě nasměrují."
await message.channel.send(response)
# Skip responding if the user has private DM's disabled
except discord.errors.Forbidden:
pass
logger.info("Message sent to DMs, skipping")
return
if is_thread_created(message) or message.is_system():
Expand Down

0 comments on commit bffddde

Please sign in to comment.