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
.WithContent($"{Program.cfgjson.Emoji.Error}{user.Mention} was already banned a few seconds ago, refusing yours to prevent collisions. If you meant to ban them again, try again in a few seconds.")
@@ -205,6 +232,29 @@ public async Task BanCmd(TextCommandContext ctx,
205
232
[Description("The user you wish to ban. Should be a mention or ID.")]DiscordUsertargetMember,
206
233
[RemainingText,Description("The time and reason for the ban. e.g. '14d trolling' NOTE: Add 'appeal' to the start of the reason to include an appeal link")]stringtimeAndReason="No reason specified.")
207
234
{
235
+
// collision detection
236
+
if(MostRecentBanis not null&&targetMember.Id==MostRecentBan.MemberId)
varresp=awaitctx.Channel.SendMessageAsync($"{Program.cfgjson.Emoji.BSOD} I was asked to ban someone twice within a few seconds, but I'm not going to. If I'm wrong, try again in a few seconds.");
243
+
awaitTask.Delay(5000);
244
+
awaitresp.DeleteAsync();
245
+
return;
246
+
}
247
+
}
248
+
249
+
MostRecentBan=new()
250
+
{
251
+
MemberId=targetMember.Id,
252
+
ActionTime=DateTime.UtcNow,
253
+
ModId=ctx.User.Id,
254
+
ServerId=ctx.Guild.Id,
255
+
Reason=timeAndReason,
256
+
Stub=true
257
+
};
208
258
209
259
if(targetMember.IsBot)
210
260
{
@@ -292,6 +342,31 @@ public async Task BankeepCmd(TextCommandContext ctx,
292
342
[Description("The user you wish to ban. Should be a mention or ID.")]DiscordUsertargetMember,
293
343
[RemainingText,Description("The time and reason for the ban. e.g. '14d trolling' NOTE: Add 'appeal' to the start of the reason to include an appeal link")]stringtimeAndReason="No reason specified.")
294
344
{
345
+
// collision detection
346
+
if(MostRecentBanis not null&&targetMember.Id==MostRecentBan.MemberId)
varresp=awaitctx.Channel.SendMessageAsync($"{Program.cfgjson.Emoji.BSOD} I was asked to ban someone twice within a few seconds, but I'm not going to. If I'm wrong, try again in a few seconds.");
.WithContent($"{Program.cfgjson.Emoji.Error}{targetUser.Mention} was already muted a few seconds ago, refusing yours to prevent collisions. If you meant to mute them again, try again in a few seconds.")
[RemainingText,Description("Combined argument for the time and reason for the mute. For example '1h rule 7' or 'rule 10'")]stringtimeAndReason="No reason specified."
243
270
)
244
271
{
272
+
// collision detection
273
+
if(MuteHelpers.MostRecentMuteis not null&&targetUser.Id==MuteHelpers.MostRecentMute.MemberId)
varresp=awaitctx.Channel.SendMessageAsync($"{Program.cfgjson.Emoji.BSOD} I was asked to mute someone twice within a few seconds, but I'm not going to. If I'm wrong, try again in a few seconds.");
0 commit comments