Discord doesn't separate the
Pin Message and
Delete Message permissions, so if like the Party Corgi Network Server you want to give people the ability to pin messages while also not allowing them to delete arbitrary messages from other users, you can do it with a bot command.
In our case, we used Rust and Serenity to implement a
!pin <message-id> command as seen here:
Implementing the command requires getting the
Message using the
MessageId (both as their
u64 representations), and then calling
.pin() on the message itself. Note that we're parsing into a
u64 from the message contents here, so strings and such would cause either the parse or the
get_message to fail.
Note: to get the message id you must right click on a message and click "Copy ID"
If you don't see the option to
Copy ID you have to enable the developer tools in discord. Go to your user settings, then to the Appearance tab, and scroll to the bottom to see this
Developer Mode toggle.