Skip to content

Commit

Permalink
Merge pull request #2 from Turolatias/master
Browse files Browse the repository at this point in the history
Guides improvements
  • Loading branch information
CompeyDev authored Sep 15, 2024
2 parents 9627d56 + d11fad3 commit 897aa1a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
6 changes: 6 additions & 0 deletions src/content/docs/guides/attachments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ luau supports sending these attachments through the `AttachmentBuilder` object.
```
</details>

:::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 message content!
:::

That's all! For more details, refer to the relevant docs;

- [DiscordAttachment](/classes/objects/discordattachment/)
Expand Down
14 changes: 10 additions & 4 deletions src/content/docs/guides/embeds.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 in the `Applications` tab
- 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()
Expand All @@ -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()
Expand All @@ -59,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))
```
</Steps>

Expand All @@ -83,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)

Expand Down

0 comments on commit 897aa1a

Please sign in to comment.