-
Notifications
You must be signed in to change notification settings - Fork 152
Expand file tree
/
Copy pathembed.lua
More file actions
49 lines (42 loc) · 1.16 KB
/
Copy pathembed.lua
File metadata and controls
49 lines (42 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
local discordia = require("discordia")
local client = discordia.Client()
-- enables receiving message.content so it is not empty
-- make sure you also enable it in Developer Portal
-- see https://github.com/SinisterRectus/Discordia/discussions/369
client:enableIntents(discordia.enums.gatewayIntent.messageContent)
client:on("ready", function() -- bot is ready
print("Logged in as " .. client.user.username)
end)
client:on("messageCreate", function(message)
local content = message.content
local author = message.author
if content == "!embed" then
message:reply {
embed = {
title = "Embed Title",
description = "Here is my fancy description!",
author = {
name = author.username,
icon_url = author.avatarURL
},
fields = { -- array of fields
{
name = "Field 1",
value = "This is some information",
inline = true
},
{
name = "Field 2",
value = "This is some more information",
inline = false
}
},
footer = {
text = "Created with Discordia"
},
color = 0x000000 -- hex color code
}
}
end
end)
client:run("Bot BOT_TOKEN") -- replace BOT_TOKEN with your bot token