mirror of
https://github.com/Paillat-dev/Botator.git
synced 2026-01-02 01:06:19 +00:00
Update code.py
This commit is contained in:
10
code/code.py
10
code/code.py
@@ -294,11 +294,11 @@ async def on_message(message):
|
||||
else :
|
||||
debug("The message has been sent in the wrong channel")
|
||||
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,))
|
||||
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.")
|
||||
if c.fetchone()[0] >= 5000:
|
||||
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 5000 times in the last 24 hours in this guild. Please try again in 24h.")
|
||||
return
|
||||
#add 1 to the uses_count_today
|
||||
#show that the bot is typing
|
||||
@@ -506,4 +506,4 @@ bot.loop.create_task(check_day_task())
|
||||
# Replace the following with your bot's token
|
||||
with open("key.txt") as f:
|
||||
key = f.read()
|
||||
bot.run(key)
|
||||
bot.run(key)
|
||||
|
||||
Reference in New Issue
Block a user