mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-17 03:00:13 +00:00
Support threads/posts in logs
Support setting the log channel to a forum post or public thread. The bot will unlock a post if it gets archived. Co-Authored-By: spiral <spiral@spiral.sh>
This commit is contained in:
parent
37025bbeb3
commit
d8933a21de
3 changed files with 2 additions and 11 deletions
|
|
@ -46,7 +46,7 @@ public class ServerConfig
|
|||
var channelString = ctx.PeekArgument();
|
||||
channel = await ctx.MatchChannel();
|
||||
if (channel == null || channel.GuildId != ctx.Guild.Id) throw Errors.ChannelNotFound(channelString);
|
||||
if (channel.Type != Channel.ChannelType.GuildText)
|
||||
if (channel.Type != Channel.ChannelType.GuildText && channel.Type != Channel.ChannelType.GuildPublicThread)
|
||||
throw new PKError("PluralKit cannot log messages to this type of channel.");
|
||||
|
||||
var perms = await _cache.PermissionsIn(channel.Id);
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ public class LogChannelService
|
|||
|
||||
// Find log channel and check if valid
|
||||
var logChannel = await FindLogChannel(guildId, logChannelId.Value);
|
||||
if (logChannel == null || logChannel.Type != Channel.ChannelType.GuildText) return null;
|
||||
if (logChannel == null || logChannel.Type != Channel.ChannelType.GuildText && logChannel.Type != Channel.ChannelType.GuildPublicThread) return null;
|
||||
|
||||
// Check bot permissions
|
||||
var perms = await GetPermissionsInLogChannel(logChannel);
|
||||
|
|
|
|||
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
"PluralKit": {
|
||||
"Bot": {
|
||||
"Token": "BOT_TOKEN_GOES_HERE",
|
||||
"ClientId": 466707357099884544,
|
||||
},
|
||||
"Database": "Host=localhost;Port=5432;Username=myusername;Password=mypassword;Database=mydatabasename"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue