Skip to content

Commit

Permalink
Add allowed_mentions to support DM messages
Browse files Browse the repository at this point in the history
  • Loading branch information
GnomedDev committed Feb 8, 2024
1 parent a963b43 commit f2436d2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/commands/owner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ pub async fn dm(
todm.id,
todm.tag(),
attachment_url,
message,
&message,
)
.await?;

ctx.msg
.channel_id
.send_message(
&ctx.serenity_context(),
ctx.serenity_context(),
CreateMessage::default()
.content(content)
.add_embed(CreateEmbed::from(embed)),
Expand Down
3 changes: 2 additions & 1 deletion src/events/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ async fn process_support_dm(
.content(message.content.as_str())
.username(webhook_username)
.avatar_url(message.author.face())
.allowed_mentions(serenity::CreateAllowedMentions::new())
.embeds(
message
.embeds
Expand Down Expand Up @@ -423,7 +424,7 @@ async fn process_support_response(
target,
target_tag,
attachment_url,
message.content.to_string(),
&message.content,
)
.await?;

Expand Down
2 changes: 1 addition & 1 deletion src/funcs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub async fn dm_generic<'ctx, 'a>(
target: serenity::UserId,
mut target_tag: String,
attachment_url: Option<impl Into<Cow<'a, str>>>,
message: String,
message: &str,
) -> Result<(String, serenity::Embed)> {
let dm_channel = target.create_dm_channel(ctx).await?;
let sent = dm_channel
Expand Down

0 comments on commit f2436d2

Please sign in to comment.