1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-07 13:48:00 -05:00

update readmessage command to use TellAsync

This commit is contained in:
RaidMax 2023-04-03 15:56:13 -05:00
parent 611ff2ae17
commit 7c94806ece

View File

@ -49,20 +49,13 @@ namespace IW4MAdmin.Application.Commands
return;
}
var index = 1;
foreach (var inboxItem in inboxItems)
await gameEvent.Origin.TellAsync(inboxItems.Select((inboxItem, index) =>
{
await gameEvent.Origin.Tell(_translationLookup["COMMANDS_READ_MESSAGE_SUCCESS"]
.FormatExt($"{index}/{inboxItems.Count}", inboxItem.SourceClient.CurrentAlias.Name))
.WaitAsync();
var header = _translationLookup["COMMANDS_READ_MESSAGE_SUCCESS"]
.FormatExt($"{index + 1}/{inboxItems.Count}", inboxItem.SourceClient.CurrentAlias.Name);
foreach (var messageFragment in inboxItem.Message.FragmentMessageForDisplay())
{
await gameEvent.Origin.Tell(messageFragment).WaitAsync();
}
index++;
}
return new[] { header }.Union(inboxItem.Message.FragmentMessageForDisplay());
}).SelectMany(item => item));
inboxItems.ForEach(item => { item.IsDelivered = true; });