fix(modmail): correct attachment handling + include initial message in transcript
Some checks failed
CI/CD / lint (push) Failing after 43s
CI/CD / test (push) Successful in 42s
CI/CD / deploy (push) Has been skipped
CI/CD / lint (pull_request) Failing after 43s
CI/CD / test (pull_request) Successful in 48s
CI/CD / deploy (pull_request) Has been skipped
Some checks failed
CI/CD / lint (push) Failing after 43s
CI/CD / test (push) Successful in 42s
CI/CD / deploy (push) Has been skipped
CI/CD / lint (pull_request) Failing after 43s
CI/CD / test (pull_request) Successful in 48s
CI/CD / deploy (pull_request) Has been skipped
- Fix discord.File.from_attachment (nonexistent) -> Attachment.to_file() - Record initial ticket reason into transcript history
This commit is contained in:
parent
b736f4cc8b
commit
32513485c3
1 changed files with 13 additions and 1 deletions
|
|
@ -105,6 +105,18 @@ class TicketModal(discord.ui.Modal, title="Nouveau Ticket"):
|
||||||
|
|
||||||
await _send_ticket_panel(ticket_channel, interaction.user, self.category_name, self.reason.value)
|
await _send_ticket_panel(ticket_channel, interaction.user, self.category_name, self.reason.value)
|
||||||
|
|
||||||
|
cog = interaction.client.get_cog("ModMail")
|
||||||
|
if cog is not None:
|
||||||
|
cog._dm_messages.setdefault(interaction.user.id, []).append(
|
||||||
|
{
|
||||||
|
"author": interaction.user,
|
||||||
|
"content": self.reason.value,
|
||||||
|
"timestamp": discord.utils.utcnow(),
|
||||||
|
"attachments": [],
|
||||||
|
"is_staff": False,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
with contextlib.suppress(discord.HTTPException):
|
with contextlib.suppress(discord.HTTPException):
|
||||||
await interaction.followup.send(
|
await interaction.followup.send(
|
||||||
f"Ticket cree: {ticket_channel.mention}",
|
f"Ticket cree: {ticket_channel.mention}",
|
||||||
|
|
@ -520,7 +532,7 @@ class ModMail(commands.Cog):
|
||||||
await channel.send(embed=embed)
|
await channel.send(embed=embed)
|
||||||
|
|
||||||
for att in message.attachments:
|
for att in message.attachments:
|
||||||
await channel.send(file=await discord.File.from_attachment(att))
|
await channel.send(file=await att.to_file())
|
||||||
|
|
||||||
# --- COMMANDES ---
|
# --- COMMANDES ---
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue