@@ -3,9 +3,31 @@ module.exports = (bot, db, config, winston, userDocument, msg, suffix) => {
3
3
// Maintainer console for overall bot things
4
4
if ( config . maintainers . indexOf ( msg . author . id ) > - 1 && ! suffix ) {
5
5
if ( config . hosting_url ) {
6
- msg . channel . createMessage ( `🌎 ${ config . hosting_url } dashboard/overview?svrid=maintainer` ) ;
6
+ msg . channel . createMessage ( {
7
+ embed : {
8
+ author : {
9
+ name : bot . user . username ,
10
+ icon_url : bot . user . avatarURL ,
11
+ url : "https://github.com/GilbertGobbels/GAwesomeBot"
12
+ } ,
13
+ title : "Here's the link for the Maintainer Console:" ,
14
+ description : `${ config . hosting_url } dashboard/overview?svrid=maintainer` ,
15
+ color : 0x9ECDF2
16
+ }
17
+ } ) ;
7
18
} else {
8
- msg . channel . createMessage ( "**Limited mode:** You have not provided a hosting URL in the bot config, so the maintainer console is not available." ) ;
19
+ msg . channel . createMessage ( {
20
+ embed : {
21
+ author : {
22
+ name : bot . user . username ,
23
+ icon_url : bot . user . avatarURL ,
24
+ url : "https://github.com/GilbertGobbels/GAwesomeBot"
25
+ } ,
26
+ title : "Warning! Bot is running in __Limited Mode__" ,
27
+ description : "You have not provided a hosting URL in the bot config, so the maintainer console is not available." ,
28
+ color : 0xFF0000
29
+ }
30
+ } ) ;
9
31
}
10
32
}
11
33
@@ -14,20 +36,64 @@ module.exports = (bot, db, config, winston, userDocument, msg, suffix) => {
14
36
const svr = bot . serverSearch ( suffix , msg . author , userDocument ) ;
15
37
// Check if specified server exists
16
38
if ( ! svr ) {
17
- msg . channel . createMessage ( "Sorry, invalid server. 🙁 Try again?" ) ;
39
+ msg . channel . createMessage ( {
40
+ embed : {
41
+ author : {
42
+ name : bot . user . username ,
43
+ icon_url : bot . user . avatarURL ,
44
+ url : "https://github.com/GilbertGobbels/GAwesomeBot"
45
+ } ,
46
+ color : 0xFF0000 ,
47
+ title : "Error" ,
48
+ description : "Sorry, but the server name you entered is invalid. 🙁 Try again?"
49
+ }
50
+ } ) ;
18
51
// Check if sender is an admin of the specified server
19
52
} else {
20
53
const member = svr . members . get ( msg . author . id ) ;
21
54
// Get server data
22
55
db . servers . findOne ( { _id : svr . id } , ( err , serverDocument ) => {
23
56
if ( ! err && member && serverDocument && serverDocument . config . blocked . indexOf ( msg . author . id ) == - 1 ) {
24
57
if ( bot . getUserBotAdmin ( svr , serverDocument , member ) >= 3 ) {
25
- msg . channel . createMessage ( `🌎 ${ config . hosting_url } dashboard/overview?svrid=${ svr . id } ` ) ;
58
+ msg . channel . createMessage ( {
59
+ embed : {
60
+ author : {
61
+ name : bot . user . username ,
62
+ icon_url : bot . user . avatarURL ,
63
+ url : "https://github.com/GilbertGobbels/GAwesomeBot"
64
+ } ,
65
+ color : 0x00FF00 ,
66
+ title : "Here's the link to the requested Admin Panel" ,
67
+ description : `${ config . hosting_url } dashboard/overview?svrid=${ svr . id } `
68
+ }
69
+ } ) ;
26
70
} else {
27
- msg . channel . createMessage ( "You are not an admin for that server." ) ;
71
+ msg . channel . createMessage ( {
72
+ embed : {
73
+ author : {
74
+ name : bot . user . username ,
75
+ icon_url : bot . user . avatarURL ,
76
+ url : "https://github.com/GilbertGobbels/GAwesomeBot"
77
+ } ,
78
+ color : 0xFF0000 ,
79
+ title : "Error" ,
80
+ description : "You are not an admin for that server\nIf you think this was a mistake, please contact the server owner!"
81
+ }
82
+ } ) ;
28
83
}
29
84
} else {
30
- msg . channel . createMessage ( "Sorry, invalid server. 🙁 Try again?" ) ;
85
+ msg . channel . createMessage ( {
86
+ embed : {
87
+ author : {
88
+ name : bot . user . username ,
89
+ icon_url : bot . user . avatarURL ,
90
+ url : "https://github.com/GilbertGobbels/GAwesomeBot"
91
+ } ,
92
+ color : 0x9ECDF2 ,
93
+ title : "Error" ,
94
+ description : "Sorry, but the server name you entered is invalid. 🙁 Try again?"
95
+ }
96
+ } ) ;
31
97
}
32
98
} ) ;
33
99
}
0 commit comments