|
|
@ -180,6 +180,7 @@ class Modmail(commands.Cog):
|
|
|
|
if payload.channel_id == channel_id:
|
|
|
|
if payload.channel_id == channel_id:
|
|
|
|
if payload.message_id == message_id:
|
|
|
|
if payload.message_id == message_id:
|
|
|
|
if payload.emoji.name == "✅":
|
|
|
|
if payload.emoji.name == "✅":
|
|
|
|
|
|
|
|
|
|
|
|
# Get the guild
|
|
|
|
# Get the guild
|
|
|
|
guild = self.bot.get_guild(payload.guild_id)
|
|
|
|
guild = self.bot.get_guild(payload.guild_id)
|
|
|
|
# Get the member
|
|
|
|
# Get the member
|
|
|
@ -224,8 +225,7 @@ class Modmail(commands.Cog):
|
|
|
|
# Surround with try/except to catch any exceptions that may occur
|
|
|
|
# Surround with try/except to catch any exceptions that may occur
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
# Wait for the user to add a reaction
|
|
|
|
# Wait for the user to add a reaction
|
|
|
|
reaction, user = await self.bot.wait_for('reaction_add', timeout=120.0,
|
|
|
|
reaction, user = await self.bot.wait_for('reaction_add', check=emoji_check)
|
|
|
|
check=emoji_check)
|
|
|
|
|
|
|
|
except Exception as ex:
|
|
|
|
except Exception as ex:
|
|
|
|
print(ex)
|
|
|
|
print(ex)
|
|
|
|
return
|
|
|
|
return
|
|
|
@ -244,14 +244,14 @@ class Modmail(commands.Cog):
|
|
|
|
return m.author == payload.member and user_channel.id == instructions.channel.id
|
|
|
|
return m.author == payload.member and user_channel.id == instructions.channel.id
|
|
|
|
|
|
|
|
|
|
|
|
# Wait for the message from the author
|
|
|
|
# Wait for the message from the author
|
|
|
|
msg = await self.bot.wait_for('message', check=check, timeout=300)
|
|
|
|
msg = await self.bot.wait_for('message', check=check)
|
|
|
|
|
|
|
|
|
|
|
|
# Making sure that the message is below 50 characters and the message was sent in the channel
|
|
|
|
# Making sure that the message is below 50 characters and the message was sent in the channel
|
|
|
|
while len(msg.content) < 50 and msg.channel == user_channel:
|
|
|
|
while len(msg.content) < 50 and msg.channel == user_channel:
|
|
|
|
await user_channel.send(embed=ErrorHandling(member))
|
|
|
|
await user_channel.send(embed=ErrorHandling(member))
|
|
|
|
|
|
|
|
|
|
|
|
# Wait for the message from the author
|
|
|
|
# Wait for the message from the author
|
|
|
|
msg = await self.bot.wait_for('message', check=check, timeout=300)
|
|
|
|
msg = await self.bot.wait_for('message', check=check)
|
|
|
|
|
|
|
|
|
|
|
|
if len(msg.content) > 50 and msg.channel == user_channel:
|
|
|
|
if len(msg.content) > 50 and msg.channel == user_channel:
|
|
|
|
# Delete the previous embed
|
|
|
|
# Delete the previous embed
|
|
|
@ -264,7 +264,7 @@ class Modmail(commands.Cog):
|
|
|
|
|
|
|
|
|
|
|
|
# Let the user read the message for 5 seconds
|
|
|
|
# Let the user read the message for 5 seconds
|
|
|
|
await asyncio.sleep(5)
|
|
|
|
await asyncio.sleep(5)
|
|
|
|
|
|
|
|
|
|
|
|
await user_channel.delete()
|
|
|
|
await user_channel.delete()
|
|
|
|
# Log the message within the database
|
|
|
|
# Log the message within the database
|
|
|
|
# logModMail(ctx, self.anon, msg)
|
|
|
|
# logModMail(ctx, self.anon, msg)
|
|
|
|