From d75da82e75092f3fafb10e442396344ce3e5217e Mon Sep 17 00:00:00 2001 From: Naman Sood Date: Tue, 28 Jun 2022 00:44:29 -0500 Subject: [PATCH] posts: add update to discord post Signed-off-by: Naman Sood --- posts/discordjs-role-perms.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/posts/discordjs-role-perms.md b/posts/discordjs-role-perms.md index 985cec9..5ac8c9a 100644 --- a/posts/discordjs-role-perms.md +++ b/posts/discordjs-role-perms.md @@ -4,6 +4,8 @@ summary: Secrets that the documentation won't tell you (not sure why though). time: 1642314274 --- +**UPDATE (June 28, 2022):** Most of this article is now outdated. The Discord.js API has been updated and these steps _do not work_ any more, and they have provided a much nicer API (and one that's actually documented!) since. I don't think I'll write another article about how to fix this, but [here](https://github.com/tendstofortytwo/counter-bot/commit/5d39629082d59297418b5be23df5b90b1db16bf0) is a diff of me going from the contnts of this article to doing things "the right way". + So I was recently making a very simple [Discord bot](https://github.com/namansood/counter-bot) as a joke. Since I like JavaScript, I found a JavaScript library to help me out with this, [discord.js](https://discord.js.org), and got started. As part of this, the bot had a slash command that was supposed to be accessible only to people with a certain role in the server. Now I imagine this situation comes up often (eg. only allow moderators to ban pepole, etc), so I was surprised that the documentation on this was a bit lacking. The main website is basically a reference page, and there's a [guide website](https://discordjs.guide) linked in the header. Using the guide, I was able to create the command that I wanted, minus the role thing.