mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +00:00
Bail early if we don't have send message permission when proxying
This commit is contained in:
parent
66eb012e4a
commit
cb1c44a27f
1 changed files with 4 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue