File tree 2 files changed +93
-0
lines changed
2 files changed +93
-0
lines changed Original file line number Diff line number Diff line change
1
+ class MessageButton {
2
+ constructor ( ) {
3
+ this . useful = true ;
4
+
5
+ return this ;
6
+ }
7
+ }
8
+
9
+ module . exports = Eris => {
10
+ Eris . MessageButton = MessageButton ;
11
+ } ;
Original file line number Diff line number Diff line change
1
+ class MessageEmbed {
2
+ constructor ( ) {
3
+ this . fields = [ ] ;
4
+
5
+ return this ;
6
+ }
7
+
8
+ setAuthor ( name , icon_url , url ) {
9
+ this . author = { name, icon_url, url } ;
10
+
11
+ return this ;
12
+ }
13
+
14
+ setColor ( color ) {
15
+ if ( color . startsWith ( "#" ) ) this . color = parseInt ( color , 16 ) ;
16
+ else this . color = color ;
17
+
18
+ return this ;
19
+ }
20
+
21
+ setTitle ( title ) {
22
+ this . title = title . toString ( ) . slice ( 256 ) ;
23
+
24
+ return this ;
25
+ }
26
+
27
+ setUrl ( url ) {
28
+ this . url = url ;
29
+
30
+ return this ;
31
+ }
32
+
33
+ setDescription ( description ) {
34
+ this . description = description . toString ( ) . slice ( 2048 ) ;
35
+
36
+ return this ;
37
+ }
38
+
39
+ setThumbnail ( url ) {
40
+ this . thumbnail = { url } ;
41
+
42
+ return this ;
43
+ }
44
+
45
+ setImage ( url ) {
46
+ this . image = { url } ;
47
+
48
+ return this ;
49
+ }
50
+
51
+ setTimestamp ( time = new Date ( ) ) {
52
+ this . timestamp = time ;
53
+
54
+ return this ;
55
+ }
56
+
57
+ setFooter ( text , icon_url ) {
58
+ this . footer = { text : text . toString ( ) . slice ( 2048 ) , icon_url } ;
59
+
60
+ return this ;
61
+ }
62
+
63
+ addField ( name , value , inline = false ) {
64
+ if ( this . fields . length >= 25 ) {
65
+ console . warn ( "Limit of 25 fields exceeded, no field was added" ) ;
66
+ return this ;
67
+ } else if ( ! name || ! value ) {
68
+ console . warn ( "Both a name & value are needed, no field was addded" ) ;
69
+ return this ;
70
+ }
71
+
72
+ this . fields . push ( { name : toString ( ) . slice ( 256 ) , value : value . toString ( ) . slice ( 256 ) , inline } ) ;
73
+ }
74
+
75
+ clearFields ( ) {
76
+ this . fields = [ ] ;
77
+ }
78
+ }
79
+
80
+ module . exports = Eris => {
81
+ Eris . MessageEmbed = MessageEmbed ;
82
+ } ;
You can’t perform that action at this time.
0 commit comments