File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -11,21 +11,31 @@ const RoboCommands = (msg) => ({
11
11
"ping" : ( ) => msg . reply ( '🏓pong' )
12
12
} ) ;
13
13
14
+ const LeadCommands = ( msg ) => ( {
15
+ "lead" : ( ) => msg . reply ( '👌 You are a Leadership Member' )
16
+ } ) ;
17
+
14
18
/**
15
19
* Handles incoming messages for Robo
16
20
*/
17
21
const handleMessage = ( msg ) => {
18
22
const PREFIX = 'DG!' ;
19
23
const msgs = msg . content . split ( " " )
20
24
const roboCommands = RoboCommands ( msg ) ;
25
+ let role = msg . member . guild . roles . find ( 'name' , 'Leadership' )
21
26
if ( msgs [ 0 ] == PREFIX ) {
22
27
// getting rid of DG! prefix
23
28
msgs . splice ( 0 , 1 ) ;
24
29
if ( msgs . length === 0 || msgs == undefined ) {
25
30
msg . reply ( 'At least one argument is needed to complete a task.' ) ;
26
31
} else {
27
- if ( roboCommands [ msgs . join ( " " ) ] ) {
28
- roboCommands [ msgs . join ( " " ) ] ( ) ;
32
+ if ( roboCommands [ msgs . join ( " " ) ] || LeadCommands [ msgs . join ( " " ) ] ) {
33
+ if ( role . id === msg . member . guild . roles . find ( 'name' , 'Leadership' ) . id ) {
34
+ roboCommands [ msgs . join ( " " ) ] ( ) ;
35
+ LeadCommands [ msgs . join ( " " ) ] ;
36
+ } else {
37
+ roboCommands [ msgs . join ( " " ) ] ( ) ;
38
+ }
29
39
} else {
30
40
msg . reply ( 'The command you entered is could not be found.' )
31
41
}
You can’t perform that action at this time.
0 commit comments