From 7ac5de6754507397da6285266ae37ea8b83550ee Mon Sep 17 00:00:00 2001 From: Niko Date: Mon, 11 Dec 2023 21:34:46 -0700 Subject: [PATCH] Fix profile picture and username in DMs from an artificial support channel --- scripty_bot_utils/src/dm_support.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/scripty_bot_utils/src/dm_support.rs b/scripty_bot_utils/src/dm_support.rs index 1f29e4b6..47a8ac5a 100644 --- a/scripty_bot_utils/src/dm_support.rs +++ b/scripty_bot_utils/src/dm_support.rs @@ -60,7 +60,16 @@ impl DmSupportStatus { let channel = self.get_or_create_channel(&ctx, &message.author).await; let hook = self.get_webhook(&ctx, &channel.id).await; - let mut webhook_execute = ExecuteWebhook::default(); + let mut webhook_execute = ExecuteWebhook::default() + .avatar_url(message.author.face()) + .username( + message + .author + .global_name + .as_ref() + .unwrap_or_else(|| &message.author.name) + .to_string(), + ); if !message.attachments.is_empty() { let mut attachments = Vec::new(); @@ -309,8 +318,8 @@ impl DmSupportStatus { CreateEmbed::default() .title("Closed Support Ticket") .description( - "This support ticket has now been closed.Thank you for using \ - Scripty's support system. If you require more assistance,simply \ + "This support ticket has now been closed. Thank you for using \ + Scripty's support system. If you require more assistance, simply \ send another message here to reopen a new ticket.", ), ),