mirror of
https://github.com/alterware/aw-bot.git
synced 2025-10-26 14:15:54 +00:00
chore: crazy
This commit is contained in:
14
aw.py
14
aw.py
@@ -14,6 +14,10 @@ GUILD_ID = 1110531063161299074
|
||||
BOT_LOG = 1112049391482703873
|
||||
GENERAL_CHANNEL = 1110531063744303138
|
||||
|
||||
CRAZY_USER_ID = 1319364607487512658
|
||||
CRAZY_URL = "https://cdn.discordapp.com/attachments/1119371841711112314/1329770453744746559/download.png"
|
||||
crazy_last_response_time = None
|
||||
|
||||
# Define the channel IDs where auto responds are allowed
|
||||
ALLOWED_CHANNELS = [
|
||||
GENERAL_CHANNEL,
|
||||
@@ -330,6 +334,8 @@ async def on_message_edit(before, after):
|
||||
|
||||
@bot.event
|
||||
async def on_message(message):
|
||||
global crazy_last_response_time
|
||||
|
||||
if message.author == bot.user:
|
||||
return
|
||||
|
||||
@@ -349,6 +355,12 @@ async def on_message(message):
|
||||
if file.filename.endswith((".torrent", ".TORRENT")):
|
||||
await message.delete()
|
||||
|
||||
if message.author.id == CRAZY_USER_ID:
|
||||
now = aware_utcnow()
|
||||
if crazy_last_response_time is None or now - crazy_last_response_time >= timedelta(hours=6):
|
||||
crazy_last_response_time = now
|
||||
await message.channel.send(f"{CRAZY_URL}")
|
||||
|
||||
# Check if the message is in an allowed channel
|
||||
if message.channel.id not in ALLOWED_CHANNELS:
|
||||
return
|
||||
@@ -373,7 +385,7 @@ async def on_reaction_add(reaction, user):
|
||||
|
||||
current_time = aware_utcnow()
|
||||
time_difference = current_time - reaction.message.created_at
|
||||
if time_difference > timedelta(minutes=5):
|
||||
if time_difference >= timedelta(minutes=5):
|
||||
return
|
||||
|
||||
if reaction.message.reference is None:
|
||||
|
||||
Reference in New Issue
Block a user