Update code.py

This commit is contained in:
Paillat
2022-11-27 16:35:19 +01:00
parent 087d17ba63
commit a974472e23

View File

@@ -139,6 +139,8 @@ async def on_message(message):
#check if the bot hasn't been used more than 200 times in the last 24 hours (uses_count_today)
c.execute("SELECT uses_count_today FROM data WHERE guild_id = ?", (message.guild.id,))
if c.fetchone()[0] >= 200:
debug("The bot has been used more than 200 times in the last 24 hours in this guild")
await message.channel.send("The bot has been used more than 200 times in the last 24 hours in this guild. Please try again in 24h.")
return
#add 1 to the uses_count_today
c.execute("UPDATE data SET uses_count_today = uses_count_today + 1 WHERE guild_id = ?", (message.guild.id,))