From 81055f38cd7b1d91ee4a8b6682f1dd8ddd10fc65 Mon Sep 17 00:00:00 2001 From: aikaterna <20862007+aikaterna@users.noreply.github.com> Date: Sat, 27 Oct 2018 12:08:22 -0700 Subject: [PATCH] Only reply with status messages if no away message set --- away/away.py | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/away/away.py b/away/away.py index 65c469a..81bae19 100644 --- a/away/away.py +++ b/away/away.py @@ -113,31 +113,31 @@ class Away(BaseCog): else: msg = await self.make_text_message(author, away_msg, "away") await message.channel.send(msg) - idle_msg = await self._away.user(author).IDLE_MESSAGE() - if idle_msg and author.status == discord.Status.idle: - if message.channel.permissions_for(guild.me).embed_links: - em = await self.make_embed_message(author, idle_msg, "idle") - await message.channel.send(embed=em) - else: - msg = await self.make_text_message(author, idle_msg, "idle") - await message.channel.send(msg) - dnd_msg = await self._away.user(author).DND_MESSAGE() - if dnd_msg and author.status == discord.Status.dnd: - if message.channel.permissions_for(guild.me).embed_links: - em = await self.make_embed_message(author, dnd_msg, "dnd") - await message.channel.send(embed=em) - else: - msg = await self.make_text_message(author, dnd_msg, "dnd") - await message.channel.send(msg) - offline_msg = await self._away.user(author).OFFLINE_MESSAGE() - if offline_msg and author.status == discord.Status.offline: - if message.channel.permissions_for(guild.me).embed_links: - em = await self.make_embed_message(author, offline_msg, "offline") - await message.channel.send(embed=em) - else: - msg = await self.make_text_message(author, offline_msg, "offline") - await message.channel.send(msg) - + else: + idle_msg = await self._away.user(author).IDLE_MESSAGE() + if idle_msg and author.status == discord.Status.idle: + if message.channel.permissions_for(guild.me).embed_links: + em = await self.make_embed_message(author, idle_msg, "idle") + await message.channel.send(embed=em) + else: + msg = await self.make_text_message(author, idle_msg, "idle") + await message.channel.send(msg) + dnd_msg = await self._away.user(author).DND_MESSAGE() + if dnd_msg and author.status == discord.Status.dnd: + if message.channel.permissions_for(guild.me).embed_links: + em = await self.make_embed_message(author, dnd_msg, "dnd") + await message.channel.send(embed=em) + else: + msg = await self.make_text_message(author, dnd_msg, "dnd") + await message.channel.send(msg) + offline_msg = await self._away.user(author).OFFLINE_MESSAGE() + if offline_msg and author.status == discord.Status.offline: + if message.channel.permissions_for(guild.me).embed_links: + em = await self.make_embed_message(author, offline_msg, "offline") + await message.channel.send(embed=em) + else: + msg = await self.make_text_message(author, offline_msg, "offline") + await message.channel.send(msg) @commands.command(name="away") async def away_(self, ctx, *, message:str=None):