forked from projectdysnomia/dysnomia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
embed.js
45 lines (40 loc) · 1.63 KB
/
embed.js
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
const Dysnomia = require("@projectdysnomia/dysnomia");
// Replace TOKEN with your bot account's token
const bot = new Dysnomia.Client("Bot TOKEN");
bot.on("ready", () => { // When the bot is ready
console.log("Ready!"); // Log "Ready!"
});
bot.on("error", (err) => {
console.error(err); // or your preferred logger
});
bot.on("messageCreate", (msg) => { // When a message is created
if(msg.content === "!embed") { // If the message content is "!embed"
bot.createMessage(msg.channel.id, {
embeds: [{
title: "I'm an embed!", // Title of the embed
description: "Here is some more info, with **awesome** formatting.\nPretty *neat*, huh?",
author: { // Author property
name: msg.author.username,
icon_url: msg.author.avatarURL
},
color: 0x008000, // Color, either in hex (show), or a base-10 integer
fields: [ // Array of field objects
{
name: "Some extra info.", // Field title
value: "Some extra value.", // Field
inline: true // Whether you want multiple fields in same line
},
{
name: "Some more extra info.",
value: "Another extra value.",
inline: true
}
],
footer: { // Footer text
text: "Created with Dysnomia."
}
}]
});
}
});
bot.connect(); // Get the bot to connect to Discord