File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,14 @@ export async function runAddUserCommand(
31
31
formatted_body : "You aren't a moderator!" ,
32
32
} ) ;
33
33
}
34
+ if ( Object . keys ( db . mods ) . length > 0 ) { // make sure a malicious user cannot hax with autojoin on
35
+ return client . sendMessage ( roomId , {
36
+ body : "It seems that there is already a moderator in the database.\nIf this is a mistake, please manually clear graimdb.json" ,
37
+ msgtype : "m.notice" ,
38
+ format : "org.matrix.custom.html" ,
39
+ formatted_body : "It seems that there is already a moderator in the database.<br/>If this is a mistake, please manually clear graimdb.json" ,
40
+ } ) ;
41
+ }
34
42
}
35
43
36
44
if ( ! args [ 3 ] ) {
@@ -122,7 +130,8 @@ export async function runAddUserCommand(
122
130
` Discord: ${ htmlEscape ( user . discord ) } <br/>` +
123
131
`Moderator? ${ moderator ? "Yes" : "No" } ` ,
124
132
} ) ;
125
- } catch {
133
+ } catch ( err ) {
134
+ console . log ( err ) ;
126
135
return client . sendMessage ( roomId , {
127
136
body : "Something went wrong running this command" ,
128
137
msgtype : "m.notice" ,
You can’t perform that action at this time.
0 commit comments