Skip to content

Commit 4717605

Browse files
committed
Added BetterEmbed class.
1 parent 0afdddd commit 4717605

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

src/BetterEmbed.ts

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import {MessageEmbed} from 'discord.js';
2+
3+
export default class BetterEmbed extends MessageEmbed {
4+
public static limits = {
5+
author: {
6+
name: 256,
7+
},
8+
title: 256,
9+
description: 2048,
10+
footer: {
11+
text: 2048,
12+
},
13+
fields: {
14+
size: 25,
15+
name: 256,
16+
value: 1024,
17+
},
18+
}
19+
20+
public static templates = {
21+
basic: {
22+
footer: {
23+
text: '${client.user.username}',
24+
iconURL: '${client.user.displayAvatarURL()}',
25+
},
26+
timestamp: new Date(),
27+
},
28+
color: {
29+
color: '#4b5afd',
30+
},
31+
get complete() {
32+
return {
33+
...this.basic,
34+
...this.color,
35+
title: '${title}',
36+
description: '${description}',
37+
};
38+
},
39+
get image() {
40+
return {
41+
...this.complete,
42+
image: {
43+
url: '${image}',
44+
},
45+
};
46+
},
47+
};
48+
}

0 commit comments

Comments
 (0)