yeah ok this is good i think

This commit is contained in:
Glitchy 2025-05-09 19:25:14 +00:00
parent abbf7aa544
commit 7849e76d28

View file

@ -5,15 +5,24 @@ class AfkCommands:
async def handle_afk_dm(self, message): async def handle_afk_dm(self, message):
"""Handle DMs when in AFK mode""" """Handle DMs when in AFK mode"""
if self.bot.AFK_STATUS and message.author.id not in self.bot.AFK_NOTIFIED_USERS: if self.bot.AFK_STATUS and message.author.id not in self.bot.AFK_NOTIFIED_USERS:
self.bot.AFK_NOTIFIED_USERS.append(message.author.id)
await message.reply( await message.reply(
"Heya, I'm not at my computer right now, if you're requesting something please follow <https://nohello.club>. I'll let you know when I'm back :) \n\n-# This action was automated." "Heya, I'm not at my computer right now, if you're requesting something please follow <https://nohello.club>. I'll let you know when I'm back :) \n\n-# This action was automated."
) )
self.bot.AFK_NOTIFIED_USERS.append(message.author.id) await message.channel.send(f"AFK reason:\n{self.bot.AFK_REASON}")
async def cmd_afk(self, message): async def cmd_afk(self, message):
"""Enable AFK mode""" """Enable AFK mode"""
if not self.bot.AFK_STATUS: if not self.bot.AFK_STATUS:
self.bot.AFK_STATUS = True self.bot.AFK_STATUS = True
try:
self.bot.AFK_REASON = message.content[5:]
except IndexError:
pass
finally:
if not self.bot.AFK_REASON.strip():
self.bot.AFK_REASON = "None"
await message.reply("k") await message.reply("k")
else: else:
await message.reply("You are already in AFK mode.", silent=True) await message.reply("You are already in AFK mode.", silent=True)