Skip to content

Commit

Permalink
Fix profile picture and username in DMs from an artificial support ch…
Browse files Browse the repository at this point in the history
…annel
  • Loading branch information
tazz4843 committed Dec 12, 2023
1 parent a569a35 commit 7ac5de6
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions scripty_bot_utils/src/dm_support.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Check warning on line 70 in scripty_bot_utils/src/dm_support.rs

View workflow job for this annotation

GitHub Actions / Clippy Output

unnecessary closure used to substitute value for `Option::None`

warning: unnecessary closure used to substitute value for `Option::None` --> scripty_bot_utils/src/dm_support.rs:66:5 | 66 | / message 67 | | .author 68 | | .global_name 69 | | .as_ref() 70 | | .unwrap_or_else(|| &message.author.name) | |______________________--------------------------------------^ | | | help: use `unwrap_or(..)` instead: `unwrap_or(&message.author.name)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default
.to_string(),
);

if !message.attachments.is_empty() {
let mut attachments = Vec::new();
Expand Down Expand Up @@ -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.",
),
),
Expand Down

0 comments on commit 7ac5de6

Please sign in to comment.