Skip to content

Commit

Permalink
Update modmail.py
Browse files Browse the repository at this point in the history
  • Loading branch information
bugsbirb committed Dec 8, 2024
1 parent fed9dbd commit 1ab17c5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Cogs/Events/modmail.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ async def Close(interaction: discord.Interaction, reason=None):
Modmail = await modmail.find_one({"user_id": interaction.user.id})
else:
Modmail = await modmail.find_one({"channel_id": interaction.channel.id})
TranscriptID = random.randint(100, 50000)
if not Modmail:
return await interaction.followup.send(
content=f"{no} **{interaction.user.display_name},** you have no active modmail."
Expand All @@ -104,6 +103,11 @@ async def Close(interaction: discord.Interaction, reason=None):
)
ModmailType = Config.get("Module Options", {}).get("ModmailType", "channel")
channel = interaction.client.get_channel(int(Modmail.get("channel_id")))

channelcreated = f"{channel.created_at.strftime('%d/%m/%Y')}"
TranscriptID = random.randint(100, 50000)


# // Commit Modmail Extermination
await modmail.delete_one({"user_id": interaction.user.id})
if channel and ModmailType == "channel":
Expand All @@ -112,7 +116,7 @@ async def Close(interaction: discord.Interaction, reason=None):
io.BytesIO(transcript.encode()),
filename=f"transcript-{channel.name}.html",
)
channelcreated = f"{channel.created_at.strftime('%d/%m/%Y')}"

Text = ""
async for message in channel.history(limit=None, oldest_first=True):

Expand Down

0 comments on commit 1ab17c5

Please sign in to comment.