From 141b35601f9b24cbf47a2664ffa7e69610ee4635 Mon Sep 17 00:00:00 2001 From: Turolatias Date: Sat, 14 Sep 2024 23:28:33 +0200 Subject: [PATCH 1/5] Add step to allow the bot to check messages --- src/content/docs/guides/embeds.mdx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/content/docs/guides/embeds.mdx b/src/content/docs/guides/embeds.mdx index 328e5e8..f879259 100644 --- a/src/content/docs/guides/embeds.mdx +++ b/src/content/docs/guides/embeds.mdx @@ -35,7 +35,13 @@ within a message. DiscordClient:connectAsync() ``` -2. Create a Discord embed that we can respond with: +2. Allow the bot to check messages + + - Go to the [Discord Developer Portal](https://discord.com/developers/applications) + - Choose your bot application + - Go to the Bot tab and enable `MESSAGE CONTENT INTENT` + +3. Create a Discord embed that we can respond with: ```lua local responseEmbed = DiscordLuau.EmbedBuilder.new() @@ -47,7 +53,7 @@ within a message. :setFooter("This is a footer") ``` -3. Reply to the message with the newly created embed: +4. Reply to the message with the newly created embed: ```lua local responseMessage = DiscordLuau.MessageBuilder.new() From 25c22caacfcb7cb5f1e4905d577f2cf6df0819e2 Mon Sep 17 00:00:00 2001 From: Turolatias Date: Sat, 14 Sep 2024 23:31:28 +0200 Subject: [PATCH 2/5] docs: improve step 2 in embeds guide --- src/content/docs/guides/embeds.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/content/docs/guides/embeds.mdx b/src/content/docs/guides/embeds.mdx index f879259..ff66ce7 100644 --- a/src/content/docs/guides/embeds.mdx +++ b/src/content/docs/guides/embeds.mdx @@ -35,11 +35,11 @@ within a message. DiscordClient:connectAsync() ``` -2. Allow the bot to check messages +2. Allow the bot to check messages: - Go to the [Discord Developer Portal](https://discord.com/developers/applications) - - Choose your bot application - - Go to the Bot tab and enable `MESSAGE CONTENT INTENT` + - Choose your bot application in the `Applications` tab + - Go to the `Bot` tab and enable `MESSAGE CONTENT INTENT` 3. Create a Discord embed that we can respond with: From 7e9fb7890208a80d9f4e04584703f122b214dcca Mon Sep 17 00:00:00 2001 From: Turolatias Date: Sat, 14 Sep 2024 23:40:57 +0200 Subject: [PATCH 3/5] docs: add caution warning about message content intent in attachments guide --- src/content/docs/guides/attachments.mdx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/content/docs/guides/attachments.mdx b/src/content/docs/guides/attachments.mdx index 2280d7b..5282c1b 100644 --- a/src/content/docs/guides/attachments.mdx +++ b/src/content/docs/guides/attachments.mdx @@ -86,6 +86,12 @@ luau supports sending these attachments through the `AttachmentBuilder` object. ``` +:::caution + Remember to enable the message content intent on the [Discord Developer Portal](https://discord.com/developers) when the `DiscordClient.eventManager.onMessage` event is used. + + If the intent is not enabled, the bot won't have access to the messagge content! +::: + That's all! For more details, refer to the relevant docs; - [DiscordAttachment](/classes/objects/discordattachment/) From 663c26df03c00addb849f949d04868ef57c6eb9a Mon Sep 17 00:00:00 2001 From: Turolatias Date: Sun, 15 Sep 2024 14:07:43 +0200 Subject: [PATCH 4/5] docs: replace "setEmbed" with "addEmbed" (the former isn't correct) --- src/content/docs/guides/embeds.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/docs/guides/embeds.mdx b/src/content/docs/guides/embeds.mdx index ff66ce7..f18b50b 100644 --- a/src/content/docs/guides/embeds.mdx +++ b/src/content/docs/guides/embeds.mdx @@ -65,7 +65,7 @@ within a message. :addField("Field 2", "Value 2", true) :setFooter("This is a footer") - message:replyAsync(responseMessage:setEmbed(responseEmbed)) + message:replyAsync(responseMessage:addEmbed(responseEmbed)) ``` @@ -89,7 +89,7 @@ within a message. :addField("Field 2", "Value 2", true) :setFooter("This is a footer") - message:replyAsync(responseMessage:setEmbed(responseEmbed)) + message:replyAsync(responseMessage:addEmbed(responseEmbed)) end end) From d11fad333e9c3b5e96cd6e6e95b145a4d9c52fef Mon Sep 17 00:00:00 2001 From: Turolatias <77040346+Turolatias@users.noreply.github.com> Date: Sun, 15 Sep 2024 16:01:57 +0200 Subject: [PATCH 5/5] Update src/content/docs/guides/attachments.mdx Co-authored-by: Erica Marigold --- src/content/docs/guides/attachments.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/guides/attachments.mdx b/src/content/docs/guides/attachments.mdx index 5282c1b..af7dd76 100644 --- a/src/content/docs/guides/attachments.mdx +++ b/src/content/docs/guides/attachments.mdx @@ -89,7 +89,7 @@ luau supports sending these attachments through the `AttachmentBuilder` object. :::caution Remember to enable the message content intent on the [Discord Developer Portal](https://discord.com/developers) when the `DiscordClient.eventManager.onMessage` event is used. - If the intent is not enabled, the bot won't have access to the messagge content! + If the intent is not enabled, the bot won't have access to the message content! ::: That's all! For more details, refer to the relevant docs;