Bail early if we don't have send message permission when proxying
This commit is contained in:
parent
66eb012e4a
commit
cb1c44a27f
@ -167,6 +167,10 @@ namespace PluralKit.Bot
|
||||
var guildUser = await channel.Guild.GetCurrentUserAsync();
|
||||
var permissions = guildUser.GetPermissions(channel);
|
||||
|
||||
// If we can't send messages at all, just bail immediately.
|
||||
// TODO: can you have ManageMessages and *not* SendMessages? What happens then?
|
||||
if (!permissions.SendMessages && !permissions.ManageMessages) return false;
|
||||
|
||||
if (!permissions.ManageWebhooks)
|
||||
{
|
||||
// todo: PKError-ify these
|
||||
|
Loading…
Reference in New Issue
Block a user