-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathembed.js
35 lines (31 loc) · 1.03 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
const { EmbedBuilder } = require("discord.js");
const TJO_LOGO = "https://raw.githubusercontent.com/pcpd-tjo/tjo-assets/7a3fafec818168b4b39146d3fc61ca586aebb13c/TJO_LOGO.png";
// module.exports = async (properties) => {
// let embed = new EmbedBuilder()
// .setTitle(properties["Title"])
// .setDescription(properties["Description"])
// .setColor(properties["Color"])
// return embed
// }
class Embed {
embed
constructor({
title,
description,
colour,
fields = [] // looks like [ { name: 'Field 1', value: 'Value 1' }, { name: 'Field 2', value: 'Value 2' }, ]
}) {
const _embed = new EmbedBuilder()
.setTitle(title)
.setDescription(description)
.setColor(colour)
.setFooter({ "text": "Made by UntoldGam", "iconURL": TJO_LOGO })
.setTimestamp();
if (fields.length > 0) {
_embed.addFields(...fields);
}
this.embed = _embed;
return _embed;
}
}
module.exports = Embed;