Preliminary support for APIv9 and threads
This commit is contained in:
@@ -194,6 +194,11 @@ namespace PluralKit.Bot
|
||||
}
|
||||
|
||||
public static bool IsValidGuildChannel(Channel channel) =>
|
||||
channel.Type == Channel.ChannelType.GuildText || channel.Type == Channel.ChannelType.GuildNews;
|
||||
channel.Type is
|
||||
Channel.ChannelType.GuildText or
|
||||
Channel.ChannelType.GuildNews or
|
||||
Channel.ChannelType.GuildPublicThread or
|
||||
Channel.ChannelType.GuildPrivateThread or
|
||||
Channel.ChannelType.GuildNewsThread;
|
||||
}
|
||||
}
|
||||
|
@@ -36,10 +36,13 @@ namespace PluralKit.Bot
|
||||
|
||||
if (channel != null)
|
||||
{
|
||||
props.Add(new("GuildId", new ScalarValue(channel.Value)));
|
||||
|
||||
var botPermissions = _bot.PermissionsIn(channel.Value);
|
||||
props.Add(new("BotPermissions", new ScalarValue(botPermissions)));
|
||||
props.Add(new("ChannelId", new ScalarValue(channel.Value)));
|
||||
|
||||
if (_cache.TryGetChannel(channel.Value, out _))
|
||||
{
|
||||
var botPermissions = _bot.PermissionsIn(channel.Value);
|
||||
props.Add(new("BotPermissions", new ScalarValue(botPermissions)));
|
||||
}
|
||||
}
|
||||
|
||||
if (message != null)
|
||||
|
Reference in New Issue
Block a user