private async Task <bool> CheckBotPermissionsOrError(DiscordChannel channel) { var permissions = channel.BotPermissions(); // If we can't send messages at all, just bail immediately. // 2020-04-22: Manage Messages does *not* override a lack of Send Messages. if ((permissions & Permissions.SendMessages) == 0) { return(false); } if ((permissions & Permissions.ManageWebhooks) == 0) { // todo: PKError-ify these await channel.SendMessageAsync( $"{Emojis.Error} PluralKit does not have the *Manage Webhooks* permission in this channel, and thus cannot proxy messages. Please contact a server administrator to remedy this."); return(false); } if ((permissions & Permissions.ManageMessages) == 0) { await channel.SendMessageAsync( $"{Emojis.Error} PluralKit does not have the *Manage Messages* permission in this channel, and thus cannot delete the original trigger message. Please contact a server administrator to remedy this."); return(false); } return(true); }