Update chat.py

This commit is contained in:
Paillat
2022-12-10 01:49:23 +01:00
parent 8b6f8d1a2d
commit b11a421f15

View File

@@ -39,9 +39,10 @@ class Chat (discord.Cog) :
return return
#check if the bot hasn't been used more than 5000 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,))
debug(f"uses_count_today: {c.fetchone()[0]}")
if c.fetchone()[0] >= max_uses: if c.fetchone()[0] >= max_uses:
debug(f"The bot has been used more than {max_uses} times in the last 24 hours in this guild. Please try again in 24h.") debug(f"The bot has been used more than {max_uses} 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.") await message.channel.send(f"The bot has been used more than {max_uses} 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