mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-29 05:55:21 -04:00
Round up the "call lasted for X minutes" value
This commit is contained in:
parent
088612a78f
commit
4efa6094dc
2 changed files with 11 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
||||||
@using System
|
@using System
|
||||||
@using System.Collections.Generic
|
@using System.Collections.Generic
|
||||||
|
@using System.Globalization
|
||||||
@using System.Linq
|
@using System.Linq
|
||||||
@using System.Threading.Tasks
|
@using System.Threading.Tasks
|
||||||
@using DiscordChatExporter.Core.Discord.Data
|
@using DiscordChatExporter.Core.Discord.Data
|
||||||
|
@ -99,7 +100,7 @@
|
||||||
}
|
}
|
||||||
else if (message.Kind == MessageKind.Call)
|
else if (message.Kind == MessageKind.Call)
|
||||||
{
|
{
|
||||||
<span>started a call that lasted @(((message.CallEndedTimestamp ?? message.Timestamp) - message.Timestamp).TotalMinutes) minutes</span>
|
<span>started a call that lasted @(((message.CallEndedTimestamp ?? message.Timestamp) - message.Timestamp).TotalMinutes.ToString("n0", CultureInfo.InvariantCulture)) minutes</span>
|
||||||
}
|
}
|
||||||
else if (message.Kind == MessageKind.ChannelNameChange)
|
else if (message.Kind == MessageKind.ChannelNameChange)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using System.Linq;
|
using System.Globalization;
|
||||||
|
using System.Linq;
|
||||||
using DiscordChatExporter.Core.Discord.Data;
|
using DiscordChatExporter.Core.Discord.Data;
|
||||||
using DiscordChatExporter.Core.Utils.Extensions;
|
using DiscordChatExporter.Core.Utils.Extensions;
|
||||||
|
|
||||||
|
@ -19,7 +20,13 @@ internal static class PlainTextMessageExtensions
|
||||||
: "Removed a recipient.",
|
: "Removed a recipient.",
|
||||||
|
|
||||||
MessageKind.Call =>
|
MessageKind.Call =>
|
||||||
$"Started a call that lasted {message.CallEndedTimestamp?.Pipe(t => t - message.Timestamp).Pipe(t => (int)t.TotalMinutes) ?? 0} minutes.",
|
$"Started a call that lasted {
|
||||||
|
message
|
||||||
|
.CallEndedTimestamp?
|
||||||
|
.Pipe(t => t - message.Timestamp)
|
||||||
|
.Pipe(t => t.TotalMinutes)
|
||||||
|
.ToString("n0", CultureInfo.InvariantCulture) ?? "0"
|
||||||
|
} minutes.",
|
||||||
|
|
||||||
MessageKind.ChannelNameChange =>
|
MessageKind.ChannelNameChange =>
|
||||||
!string.IsNullOrWhiteSpace(message.Content)
|
!string.IsNullOrWhiteSpace(message.Content)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue