Add support for announcement channels

Closes #222
This commit is contained in:
Alexey Golub
2019-12-01 17:35:56 +02:00
parent 632b9f953b
commit 0d2ae8b5db
6 changed files with 22 additions and 12 deletions

View File

@@ -1,6 +1,7 @@
namespace DiscordChatExporter.Core.Models
{
// https://discordapp.com/developers/docs/resources/channel#channel-object-channel-types
// Order of enum fields needs to match the order in the docs.
public enum ChannelType
{
@@ -8,6 +9,8 @@
DirectTextChat,
GuildVoiceChat,
DirectGroupTextChat,
Category
GuildCategory,
GuildNews,
GuildStore
}
}

View File

@@ -4,6 +4,13 @@ namespace DiscordChatExporter.Core.Models
{
public static class Extensions
{
public static bool IsExportable(this ChannelType channelType) =>
channelType == ChannelType.GuildTextChat ||
channelType == ChannelType.DirectTextChat ||
channelType == ChannelType.DirectGroupTextChat ||
channelType == ChannelType.GuildNews ||
channelType == ChannelType.GuildStore;
public static string GetFileExtension(this ExportFormat format) =>
format switch
{