Replies: 1 comment 1 reply
-
You can using the message collector. Discord does not return data for the generated system message, since that's an action that is separate from pinning. Instead, you'll have to listen to incoming messages with the PinAdd message type: use serenity::model::channel::MessageType;
let channel_id = message.channel_id;
if let Some(pin_msg) = channel_id.await_reply(ctx).filter(|m| m.kind == MessageType::PinAdd).await {
pin_msg.delete(ctx).await;
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When I send a new Message in a slash command, I want to remove the Pin Message after setting the Pin.
Since the Pin function doesn't return the
MessageId
for the Pin Message, I don't see how I can do this in the command function.Example:
Beta Was this translation helpful? Give feedback.
All reactions