mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-02-03 08:39:14 +00:00
@@ -92,6 +92,7 @@
|
||||
<Compile Include="Models\ChannelType.cs" />
|
||||
<Compile Include="Models\ExportFormat.cs" />
|
||||
<Compile Include="Models\Extensions.cs" />
|
||||
<Compile Include="Models\MessageType.cs" />
|
||||
<Compile Include="Services\IMessageGroupService.cs" />
|
||||
<Compile Include="Services\MessageGroupService.cs" />
|
||||
<Compile Include="ViewModels\ErrorViewModel.cs" />
|
||||
|
||||
14
DiscordChatExporter/Models/MessageType.cs
Normal file
14
DiscordChatExporter/Models/MessageType.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace DiscordChatExporter.Models
|
||||
{
|
||||
public enum MessageType
|
||||
{
|
||||
Default,
|
||||
RecipientAdd,
|
||||
RecipientRemove,
|
||||
Call,
|
||||
ChannelNameChange,
|
||||
ChannelIconChange,
|
||||
ChannelPinnedMessage,
|
||||
GuildMemberJoin
|
||||
}
|
||||
}
|
||||
@@ -188,10 +188,23 @@ namespace DiscordChatExporter.Services
|
||||
var timeStamp = token.Value<DateTime>("timestamp");
|
||||
var editedTimeStamp = token.Value<DateTime?>("edited_timestamp");
|
||||
var content = token.Value<string>("content");
|
||||
var type = (MessageType) token.Value<int>("type");
|
||||
|
||||
// Lazy workaround for calls
|
||||
if (token["call"] != null)
|
||||
// Workarounds for non-default types
|
||||
if (type == MessageType.RecipientAdd)
|
||||
content = "Added a recipient.";
|
||||
else if (type == MessageType.RecipientRemove)
|
||||
content = "Removed a recipient.";
|
||||
else if (type == MessageType.Call)
|
||||
content = "Started a call.";
|
||||
else if (type == MessageType.ChannelNameChange)
|
||||
content = "Changed the channel name.";
|
||||
else if (type == MessageType.ChannelIconChange)
|
||||
content = "Changed the channel icon.";
|
||||
else if (type == MessageType.ChannelPinnedMessage)
|
||||
content = "Pinned a message.";
|
||||
else if (type == MessageType.GuildMemberJoin)
|
||||
content = "Joined the server.";
|
||||
|
||||
// Get author
|
||||
var author = ParseUser(token["author"]);
|
||||
|
||||
Reference in New Issue
Block a user