File tree 2 files changed +26
-0
lines changed
2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,18 @@ public async Task TqsMuteSlashCommand(
109
109
return ;
110
110
}
111
111
112
+ // Check if the user is already muted; disallow TQS-mute if so
113
+
114
+ DiscordRole mutedRole = ctx . Guild . GetRole ( Program . cfgjson . MutedRole ) ;
115
+ DiscordRole tqsMutedRole = ctx . Guild . GetRole ( Program . cfgjson . TqsMutedRole ) ;
116
+
117
+ if ( await Program . db . HashExistsAsync ( "mutes" , targetUser . Id ) || ctx . Member . Roles . Contains ( mutedRole ) || ctx . Member . Roles . Contains ( tqsMutedRole ) )
118
+ {
119
+ await ctx . EditResponseAsync ( new DiscordWebhookBuilder ( ) . WithContent ( $ "{ Program . cfgjson . Emoji . Error } { ctx . User . Mention } , that user is already muted.") ) ;
120
+ return ;
121
+ }
122
+
123
+ // Get member
112
124
DiscordMember targetMember = default ;
113
125
try
114
126
{
@@ -119,6 +131,7 @@ public async Task TqsMuteSlashCommand(
119
131
// blah
120
132
}
121
133
134
+ // Check if user to be muted is staff or TQS, and disallow if so
122
135
if ( targetMember != default && GetPermLevel ( ctx . Member ) == ServerPermLevel . TechnicalQueriesSlayer && ( GetPermLevel ( targetMember ) >= ServerPermLevel . TechnicalQueriesSlayer || targetMember . IsBot ) )
123
136
{
124
137
await ctx . EditResponseAsync ( new DiscordWebhookBuilder ( ) . WithContent ( $ "{ Program . cfgjson . Emoji . Error } { ctx . User . Mention } , you cannot mute other TQS or staff members.") ) ;
Original file line number Diff line number Diff line change @@ -113,6 +113,18 @@ public async Task TqsMuteCmd(
113
113
return ;
114
114
}
115
115
116
+ // Check if the user is already muted; disallow TQS-mute if so
117
+
118
+ DiscordRole mutedRole = ctx . Guild . GetRole ( Program . cfgjson . MutedRole ) ;
119
+ DiscordRole tqsMutedRole = ctx . Guild . GetRole ( Program . cfgjson . TqsMutedRole ) ;
120
+
121
+ if ( ( await Program . db . HashExistsAsync ( "mutes" , targetUser . Id ) ) || ( ctx . Member != default && ( ctx . Member . Roles . Contains ( mutedRole ) || ctx . Member . Roles . Contains ( tqsMutedRole ) ) ) )
122
+ {
123
+ await ctx . RespondAsync ( $ "{ Program . cfgjson . Emoji . Error } { ctx . User . Mention } , that user is already muted.") ;
124
+ return ;
125
+ }
126
+
127
+ // Get member
116
128
DiscordMember targetMember = default ;
117
129
try
118
130
{
@@ -123,6 +135,7 @@ public async Task TqsMuteCmd(
123
135
// blah
124
136
}
125
137
138
+ // Check if user to be muted is staff or TQS, and disallow if so
126
139
if ( targetMember != default && GetPermLevel ( ctx . Member ) == ServerPermLevel . TechnicalQueriesSlayer && ( GetPermLevel ( targetMember ) >= ServerPermLevel . TechnicalQueriesSlayer || targetMember . IsBot ) )
127
140
{
128
141
await ctx . Channel . SendMessageAsync ( $ "{ Program . cfgjson . Emoji . Error } { ctx . User . Mention } , you cannot mute other TQS or staff members.") ;
You can’t perform that action at this time.
0 commit comments