Skip to content

Commit

Permalink
fix: ignore if we don't have react perms
Browse files Browse the repository at this point in the history
  • Loading branch information
Lulalaby committed Jan 16, 2024
1 parent 520ac87 commit ed6f9d8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion DisCatSharp.CommandsNext/Attributes/CooldownAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using DisCatSharp.Entities;
using DisCatSharp.Entities.Core;
using DisCatSharp.Enums.Core;
using DisCatSharp.Exceptions;

namespace DisCatSharp.CommandsNext.Attributes;

Expand Down Expand Up @@ -122,7 +123,14 @@ public async Task<bool> RespondRatelimitHitAsync(CommandContext ctx, bool noHit,
if (noHit)
return true;

await ctx.Message.CreateReactionAsync(DiscordEmoji.FromName(ctx.Client, ":x:", false));
try
{
await ctx.Message.CreateReactionAsync(DiscordEmoji.FromName(ctx.Client, ":x:", false));
}
catch (UnauthorizedException)
{
// ignore
}

return false;
}
Expand Down

0 comments on commit ed6f9d8

Please sign in to comment.