You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
publicasyncTaskTqsUnmuteCmd(CommandContextctx,[Parameter("user"),Description("The user you're trying to unmute.")]DiscordUsertargetUser,[Description("The reason for the unmute.")]stringreason)
awaitctx.EditResponseAsync(newDiscordWebhookBuilder().WithContent($"{Program.cfgjson.Emoji.Error} TQS mutes are not configured, so this command does nothing. Please contact the bot maintainer if this is unexpected."));
221
+
else
222
+
awaitctx.RespondAsync($"{Program.cfgjson.Emoji.Error} TQS mutes are not configured, so this command does nothing. Please contact the bot maintainer if this is unexpected.");
223
+
return;
224
+
}
225
+
226
+
// Only allow usage in #tech-support, #tech-support-forum, and their threads
awaitctx.EditResponseAsync(newDiscordWebhookBuilder().WithContent($"{Program.cfgjson.Emoji.Error} This command can only be used in <#{Program.cfgjson.TechSupportChannel}>, <#{Program.cfgjson.SupportForumId}>, and threads in those channels!"));
234
+
else
235
+
awaitctx.RespondAsync($"{Program.cfgjson.Emoji.Error} This command can only be used in <#{Program.cfgjson.TechSupportChannel}>, <#{Program.cfgjson.SupportForumId}>, and threads in those channels!");
if(awaitProgram.db.HashExistsAsync("mutes",targetUser.Id)&&targetMemberis not null&&targetMember.Roles.Contains(tqsMutedRole))
255
+
{
256
+
// If the member has a regular mute, leave the TQS mute alone (it's only a role now & it has no effect if they also have Muted); it will be removed when they are unmuted
257
+
if(targetMember.Roles.Contains(mutedRole))
258
+
{
259
+
if(ctxisSlashCommandContext)
260
+
awaitctx.EditResponseAsync($"{Program.cfgjson.Emoji.Error}{targetUser.Mention} has been muted by a Moderator! Their TQS Mute will be removed when the Moderator-issued mute expires.");
261
+
else
262
+
awaitctx.RespondAsync($"{Program.cfgjson.Emoji.Error}{targetUser.Mention} has been muted by a Moderator! Their TQS Mute will be removed when the Moderator-issued mute expires.");
publicasyncTaskUnmuteCmd(TextCommandContextctx,[Description("The user you're trying to unmute.")]DiscordUsertargetUser,stringreason="No reason provided.")
225
310
{
226
-
reason=$"[Manual unmute by {DiscordHelpers.UniqueUsername(ctx.User)}]: {reason}";
@@ -346,7 +350,7 @@ public static async Task<bool> UnmuteUserAsync(DiscordUser targetUser, string re
346
350
{
347
351
awaitLogChannelHelper.LogMessageAsync("mod",
348
352
newDiscordMessageBuilder()
349
-
.WithContent($"{Program.cfgjson.Emoji.Information} Attempt to remove Muted role from {targetUser.Mention} failed because the user could not be found.\nThis is expected if the user was banned or left.")
353
+
.WithContent($"{Program.cfgjson.Emoji.Information} Attempt to remove {(isTqsUnmute?"TQS ":"")}Muted role from {targetUser.Mention} failed because the user could not be found.\nThis is expected if the user was banned or left.")
.WithContent($"{Program.cfgjson.Emoji.Error} Attempt to removed Muted role from {targetUser.Mention} failed because of a Discord API error!"+
404
+
.WithContent($"{Program.cfgjson.Emoji.Error} Attempt to remove {(isTqsUnmute?"TQS ":"")}Muted role from {targetUser.Mention} failed because of a Discord API error!"+
397
405
$"\nIf the role was removed manually, this error can be disregarded safely.")
?$"{Program.cfgjson.Emoji.Information}{targetUser.Mention} was successfully unmuted by {modUser.Mention}!"
425
+
?$"{Program.cfgjson.Emoji.Information}{targetUser.Mention} was successfully {(isTqsUnmute?"TQS-":"")}unmuted by {modUser.Mention}!\nReason: **{reason}**"
0 commit comments