From e97c8a5430631d46972185605b007fa7500c5c22 Mon Sep 17 00:00:00 2001 From: Jia Rong Yee Date: Sun, 8 Oct 2017 18:24:38 +0800 Subject: [PATCH 1/2] use a command called reply please --- bot.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bot.py b/bot.py index 8ea0ace5a8..fc1ae32986 100644 --- a/bot.py +++ b/bot.py @@ -258,12 +258,13 @@ async def on_message(self, message): await self.process_commands(message) if isinstance(message.channel, discord.DMChannel): await self.process_modmail(message) - else: - c_id = message.channel.category_id - categ = discord.utils.get(message.guild.categories, id=c_id) - if categ is not None: - if categ.name == 'modmail': - await self.process_reply(message) + @commands.command() + async def reply(self, ctx): + categ = discord.utils.get(ctx.message.guild.categories, id=ctx.message.channel.category_id) + if categ is not None: + if categ.name == 'modmail': + await self.process_reply(ctx.message) + if __name__ == '__main__': Modmail.init() From 7fc21985c1b98f9fe0b43f9d299bd9b492f05259 Mon Sep 17 00:00:00 2001 From: verixx Date: Sun, 8 Oct 2017 21:28:06 +1100 Subject: [PATCH 2/2] Changed slightly fine. --- bot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index fc1ae32986..71d7ebf482 100644 --- a/bot.py +++ b/bot.py @@ -260,10 +260,11 @@ async def on_message(self, message): await self.process_modmail(message) @commands.command() - async def reply(self, ctx): + async def reply(self, ctx, *, msg): categ = discord.utils.get(ctx.message.guild.categories, id=ctx.message.channel.category_id) if categ is not None: if categ.name == 'modmail': + ctx.message.content = msg await self.process_reply(ctx.message) if __name__ == '__main__':