mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-17 11:10:13 +00:00
fix: let you blacklist any channel you can proxy in
This commit is contained in:
parent
debfc46776
commit
35489260e4
2 changed files with 13 additions and 1 deletions
|
|
@ -204,7 +204,17 @@ public class ServerConfig
|
|||
var affectedChannels = new List<Channel>();
|
||||
if (ctx.Match("all"))
|
||||
affectedChannels = (await _cache.GetGuildChannels(ctx.Guild.Id))
|
||||
.Where(x => x.Type == Channel.ChannelType.GuildText).ToList();
|
||||
// All the channel types you can proxy in. Taken from ProxyService
|
||||
.Where(x => x.Type == Channel.ChannelType.GuildText
|
||||
|| x.Type == Channel.ChannelType.GuildPublicThread
|
||||
|| x.Type == Channel.ChannelType.GuildPrivateThread
|
||||
|| x.Type == Channel.ChannelType.GuildNews
|
||||
|| x.Type == Channel.ChannelType.GuildNewsThread
|
||||
|| x.Type == Channel.ChannelType.GuildVoice
|
||||
|| x.Type == Channel.ChannelType.GuildStageVoice
|
||||
|| x.Type == Channel.ChannelType.GuildForum
|
||||
|| x.Type == Channel.ChannelType.GuildMedia
|
||||
).ToList();
|
||||
else if (!ctx.HasNext()) throw new PKSyntaxError("You must pass one or more #channels.");
|
||||
else
|
||||
while (ctx.HasNext())
|
||||
|
|
|
|||
|
|
@ -118,6 +118,8 @@ public class ProxyService
|
|||
// this is explicitly selecting known channel types so that when Discord add new
|
||||
// ones, users don't get flooded with error codes if that new channel type doesn't
|
||||
// support a feature we need for proxying
|
||||
// Note: If you add new channels to this, also add them to the allowed channel types
|
||||
// for blacklisting
|
||||
return ch.Type switch
|
||||
{
|
||||
Channel.ChannelType.GuildText => true,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue