This repository was archived by the owner on Jan 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmEmbeds.js
More file actions
56 lines (51 loc) · 1.34 KB
/
mEmbeds.js
File metadata and controls
56 lines (51 loc) · 1.34 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
50
51
52
53
54
55
56
"use strict";
let defaultEmbed = { embed:{} };
class mEmbeds {
constructor(user) {
this.embed = JSON.parse(JSON.stringify(defaultEmbed));
this.embed.embed.timestamp = new Date();
if (user) {
this.embed.embed.footer = { "text":user.username + "#" + user.discriminator, "icon_url":user.avatarURL };
}
else {this.embed.embed.footer = {};}
this.embed.embed.author = [];
this.embed.embed.fields = [];
}
setDefault() {
defaultEmbed = this.embed;
}
setTitle(title, url) {
this.embed.embed.title = title;
this.embed.embed.url = url;
}
setDesc(desc) {
this.embed.embed.description = desc;
}
setColor(color) {
this.embed.embed.color = color;
}
setTimestamp(timestamp) {
this.embed.embed.timestamp = timestamp;
}
setFooter(text, url) {
this.embed.embed.footer.text = text;
this.embed.embed.footer.icon_url = url;
}
setThumb(url) {
this.embed.embed.thumbnail = { url:url };
}
setImage(url) {
this.embed.embed.image = { url:url };
}
setAuthor(name, icon, url) {
this.embed.embed.author = { name:name, icon_url:icon, url:url };
/* this.embed.embed.author.name = name
this.embed.embed.author.icon_url = icon
this.embed.embed.author.url = url*/
}
addField(name, value, inline) {
if (!inline) {inline = false;}
this.embed.embed.fields.push({ name:name, value:value, inline:inline });
}
}
module.exports = mEmbeds;