Don't send ping message if bot doesn't have permissions
This commit is contained in:
parent
65bac86ac1
commit
60018bf69d
@ -268,8 +268,9 @@ namespace PluralKit.Bot
|
|||||||
|
|
||||||
private async Task HandleMessagePingByReaction(MessageReactionAddEventArgs args)
|
private async Task HandleMessagePingByReaction(MessageReactionAddEventArgs args)
|
||||||
{
|
{
|
||||||
// Bail in DMs
|
// Bail in DMs or if we don't have send permission
|
||||||
if (args.Channel.Type != ChannelType.Text) return;
|
if (args.Channel.Type != ChannelType.Text) return;
|
||||||
|
if (!args.Channel.BotHasAllPermissions(Permissions.SendMessages)) return;
|
||||||
|
|
||||||
// Find the message in the DB
|
// Find the message in the DB
|
||||||
var msg = await _data.GetMessage(args.Message.Id);
|
var msg = await _data.GetMessage(args.Message.Id);
|
||||||
|
Loading…
Reference in New Issue
Block a user