mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-23 03:06:53 -04:00
Set ChatLog.TotalMessageCount from ChatLogService
This commit is contained in:
parent
95a4217ab3
commit
bcad5b4ed1
2 changed files with 7 additions and 3 deletions
|
@ -16,18 +16,19 @@ namespace DiscordChatExporter.Core.Models
|
|||
|
||||
public IReadOnlyList<MessageGroup> MessageGroups { get; }
|
||||
|
||||
public int TotalMessageCount => MessageGroups.Sum(g => g.Messages.Count);
|
||||
public long TotalMessageCount { get; }
|
||||
|
||||
public Mentionables Mentionables { get; }
|
||||
|
||||
public ChatLog(Guild guild, Channel channel, DateTime? from, DateTime? to,
|
||||
IReadOnlyList<MessageGroup> messageGroups, Mentionables mentionables)
|
||||
IReadOnlyList<MessageGroup> messageGroups, long totalMessageCount, Mentionables mentionables)
|
||||
{
|
||||
Guild = guild;
|
||||
Channel = channel;
|
||||
From = from;
|
||||
To = to;
|
||||
MessageGroups = messageGroups;
|
||||
TotalMessageCount = totalMessageCount;
|
||||
Mentionables = mentionables;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,10 +24,13 @@ namespace DiscordChatExporter.Core.Services
|
|||
// Group messages
|
||||
var messageGroups = _messageGroupService.GroupMessages(messages);
|
||||
|
||||
// Get total message count
|
||||
var totalMessageCount = messages.Count;
|
||||
|
||||
// Get mentionables
|
||||
var mentionables = await _dataService.GetMentionablesAsync(token, guild.Id, messages);
|
||||
|
||||
return new ChatLog(guild, channel, from, to, messageGroups, mentionables);
|
||||
return new ChatLog(guild, channel, from, to, messageGroups, totalMessageCount, mentionables);
|
||||
}
|
||||
|
||||
public async Task<ChatLog> GetChatLogAsync(AuthToken token, string channelId,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue