#Formatting message to include a user does not ping them
1 messages · Page 1 of 1 (latest)
Hmm ok, I'm using a string function on Serenity instead of doing it manually, so its not exactly the same
Twilight:
content: format!("<@{}>", user.id), embeds: vec![embed.build()]
Serenity:
ctx.send(|builder| {
builder
.embed(|e| {
*e = embed;
e
})
.content(&user.to_string())
})
.await?;
Firefox it pings the user
Discord it does not
As per #general message I am an idiot
You can delete this post
After losing my sanity for the rest of this morning and afternoon
Looks like the reason is because it was being deferred
So... Now I just need to work out how to defer a message and not have it drop allowedmentions
@leaden coral Can I get your help again? xD
Ah darn
@novel steeple You seem to know what you are doing, so maybe you can help out? 😆
https://api.twilight.rs/twilight_model/http/interaction/struct.InteractionResponseData.html has an allowed mentions field
Data included in an interaction response.
How is it getting auto filled in though? That's what I'm trying to work out so that I can clone it and then send it when I acknowledge the deferred message
im not sure what you mean
if its None it uses https://api.twilight.rs/twilight_http/client/struct.ClientBuilder.html#method.default_allowed_mentions
A builder for Client.
Hmm, I'm not setting AllowedMentions anywhere through my application currently
you need to, by default no one is pinged
its to safeguard against unsanitized input
for example if the user doesnt have ping everyone perms but your bot does and the user gets your bot to do it
Is this helpful? https://docs.rs/twilight-http/latest/twilight_http/request/application/interaction/struct.UpdateResponse.html#examples
Edit the original message, by its token.