mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-06-02 07:39:50 -04:00
Try to parse DM group chat names instead of only using participants
Fixes #41
This commit is contained in:
parent
7b67cbc385
commit
de763f8aaa
1 changed files with 7 additions and 2 deletions
|
@ -60,8 +60,13 @@ namespace DiscordChatExporter.Core.Services
|
||||||
if (type.IsEither(ChannelType.DirectTextChat, ChannelType.DirectGroupTextChat))
|
if (type.IsEither(ChannelType.DirectTextChat, ChannelType.DirectGroupTextChat))
|
||||||
{
|
{
|
||||||
guildId = Guild.DirectMessages.Id;
|
guildId = Guild.DirectMessages.Id;
|
||||||
var recipients = token["recipients"].Select(ParseUser);
|
|
||||||
name = recipients.Select(r => r.Name).JoinToString(", ");
|
// Try to get name if it's set
|
||||||
|
name = token["name"]?.Value<string>();
|
||||||
|
|
||||||
|
// Otherwise use recipients as the name
|
||||||
|
if (name.IsBlank())
|
||||||
|
name = token["recipients"].Select(ParseUser).Select(u => u.Name).JoinToString(", ");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue