Update code.py

This commit is contained in:
Paillat
2022-12-06 19:04:02 +01:00
committed by GitHub
parent dd310fbd60
commit 9fb68cea76

View File

@@ -294,11 +294,11 @@ async def on_message(message):
else : else :
debug("The message has been sent in the wrong channel") debug("The message has been sent in the wrong channel")
return return
#check if the bot hasn't been used more than 200 times in the last 24 hours (uses_count_today) #check if the bot hasn't been used more than 5000 times in the last 24 hours (uses_count_today)
c.execute("SELECT uses_count_today FROM data WHERE guild_id = ?", (message.guild.id,)) c.execute("SELECT uses_count_today FROM data WHERE guild_id = ?", (message.guild.id,))
if c.fetchone()[0] >= 200: if c.fetchone()[0] >= 5000:
debug("The bot has been used more than 200 times in the last 24 hours in this guild") debug("The bot has been used more than 4000 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.") await message.channel.send("The bot has been used more than 5000 times in the last 24 hours in this guild. Please try again in 24h.")
return return
#add 1 to the uses_count_today #add 1 to the uses_count_today
#show that the bot is typing #show that the bot is typing