diff --git a/bot/commands/afk_commands.py b/bot/commands/afk_commands.py index 42a686c..b159e16 100644 --- a/bot/commands/afk_commands.py +++ b/bot/commands/afk_commands.py @@ -5,15 +5,24 @@ class AfkCommands: async def handle_afk_dm(self, message): """Handle DMs when in AFK mode""" 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( "Heya, I'm not at my computer right now, if you're requesting something please follow . 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): """Enable AFK mode""" if not self.bot.AFK_STATUS: 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") else: await message.reply("You are already in AFK mode.", silent=True)