Skip to content

Commit 3af7bd4

Browse files
authored
Merge pull request #4 from fourjr/patch-1
use a command called reply please
2 parents 858d3ac + 7fc2198 commit 3af7bd4

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

bot.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -258,12 +258,14 @@ async def on_message(self, message):
258258
await self.process_commands(message)
259259
if isinstance(message.channel, discord.DMChannel):
260260
await self.process_modmail(message)
261-
else:
262-
c_id = message.channel.category_id
263-
categ = discord.utils.get(message.guild.categories, id=c_id)
264-
if categ is not None:
265-
if categ.name == 'modmail':
266-
await self.process_reply(message)
267261

262+
@commands.command()
263+
async def reply(self, ctx, *, msg):
264+
categ = discord.utils.get(ctx.message.guild.categories, id=ctx.message.channel.category_id)
265+
if categ is not None:
266+
if categ.name == 'modmail':
267+
ctx.message.content = msg
268+
await self.process_reply(ctx.message)
269+
268270
if __name__ == '__main__':
269271
Modmail.init()

0 commit comments

Comments
 (0)