File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -127,9 +127,14 @@ module.exports = {
127
127
ephemeral : true ,
128
128
} ) ;
129
129
}
130
+ // // Add it to the existing database to track.
131
+ /** @type {DBuser } */
132
+ const userDB = global . userDB ;
133
+ await userDB . add_user_role ( interaction . user . id , role . name ) ;
130
134
131
135
// If they don't, let's add the role to them
132
136
await interaction . member . roles . add ( role ) ;
137
+
133
138
return await interaction . reply ( {
134
139
content : `✅ | Added you to the chat for \`${ course_with_alias } \`.` ,
135
140
ephemeral : true ,
@@ -190,6 +195,10 @@ module.exports = {
190
195
in_overwrites ( permissions , role . id )
191
196
) {
192
197
// If they do remove the role
198
+ /** @type {DBuser } */
199
+ const userDB = global . userDB ;
200
+ userDB . remove_user_role ( interaction . user . id , role . name ) ;
201
+
193
202
await interaction . member . roles . remove ( role ) ;
194
203
return await interaction . reply ( {
195
204
content : `✅ | Removed you from the role and chat for \`${ course } \`.` ,
You can’t perform that action at this time.
0 commit comments