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
* Implement pardoning warnings
Adds `isPardoned` attribute to warnings; adds /pardon and /unpardon; pardoned warnings are listed separately in !warnings output
* Exclude pardoned warnings from totals in !warnings
* Implement automatic pardoning on ban for compromised account
Automatically pardons warnings issued within last 12 hours when ban is for a compromised account
* Fix error from copy-pasting
* Fix warnings embed truncation
Make truncation dynamic based on what will fit in the embed
* Accept review suggestion
Co-authored-by: Erisa A <[email protected]>
* Use 0 as default value for compromisedAccountBanAutoPardonHours
* Show warning pardon status in warning autocomplete
* Always show pardoned field in warning embeds, add option to show inline
* Add warning autocomplete providers for pardoned & unpardoned warnings
Shifted logic for getting warnings to suggest into a single function that all 3 warning autocomplete providers use
---------
Co-authored-by: Erisa A <[email protected]>
[Parameter("user"),Description("The user to pardon a warning for.")]DiscordUseruser,
421
+
[SlashAutoCompleteProvider(typeof(UnpardonedWarningsAutocompleteProvider))][Parameter("warning"),Description("Type to search! Find the warning you want to pardon.")]stringwarning,
422
+
[Parameter("public"),Description("Whether to show the output publicly. Default: false")]boolshowPublic=false)
423
+
{
424
+
if(warning.Contains(' '))
425
+
{
426
+
warning=warning.Split(' ')[0];
427
+
}
428
+
429
+
longwarnId;
430
+
try
431
+
{
432
+
warnId=Convert.ToInt64(warning);
433
+
}
434
+
catch
435
+
{
436
+
awaitctx.RespondAsync($"{Program.cfgjson.Emoji.Error} Looks like your warning option was invalid! Give it another go?",ephemeral:true);
437
+
return;
438
+
}
439
+
440
+
varwarningObject=GetWarning(user.Id,warnId);
441
+
442
+
if(warningObjectisnull)
443
+
awaitctx.RespondAsync($"{Program.cfgjson.Emoji.Error} I couldn't find a warning for that user with that ID! Please check again.",ephemeral:true);
444
+
elseif(warningObject.Type==WarningType.Note)
445
+
{
446
+
awaitctx.RespondAsync($"{Program.cfgjson.Emoji.Error} That's a note, not a warning! Make sure you've got the right warning ID.",ephemeral:true);
awaitctx.RespondAsync($"{Program.cfgjson.Emoji.Error}{ctx.User.Mention}, as a Trial Moderator you cannot edit or delete warnings that aren't issued by you or the bot!",ephemeral:true);
[Parameter("user"),Description("The user to unpardon a warning for.")]DiscordUseruser,
483
+
[SlashAutoCompleteProvider(typeof(PardonedWarningsAutocompleteProvider))][Parameter("warning"),Description("Type to search! Find the warning you want to unpardon.")]stringwarning,
484
+
[Parameter("public"),Description("Whether to show the output publicly. Default: false")]boolshowPublic=false)
485
+
{
486
+
if(warning.Contains(' '))
487
+
{
488
+
warning=warning.Split(' ')[0];
489
+
}
490
+
491
+
longwarnId;
492
+
try
493
+
{
494
+
warnId=Convert.ToInt64(warning);
495
+
}
496
+
catch
497
+
{
498
+
awaitctx.RespondAsync($"{Program.cfgjson.Emoji.Error} Looks like your warning option was invalid! Give it another go?",ephemeral:true);
499
+
return;
500
+
}
501
+
502
+
varwarningObject=GetWarning(user.Id,warnId);
503
+
504
+
if(warningObjectisnull)
505
+
awaitctx.RespondAsync($"{Program.cfgjson.Emoji.Error} I couldn't find a warning for that user with that ID! Please check again.",ephemeral:true);
506
+
elseif(warningObject.Type==WarningType.Note)
507
+
{
508
+
awaitctx.RespondAsync($"{Program.cfgjson.Emoji.Error} That's a note, not a warning! Make sure you've got the right warning ID.",ephemeral:true);
awaitctx.RespondAsync($"{Program.cfgjson.Emoji.Error}{ctx.User.Mention}, as a Trial Moderator you cannot edit or delete warnings that aren't issued by you or the bot!",ephemeral:true);
0 commit comments