update readmessage command to use TellAsync
This commit is contained in:
parent
3364473ce2
commit
ad20572879
@ -49,20 +49,13 @@ namespace IW4MAdmin.Application.Commands
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var index = 1;
|
await gameEvent.Origin.TellAsync(inboxItems.Select((inboxItem, index) =>
|
||||||
foreach (var inboxItem in inboxItems)
|
|
||||||
{
|
{
|
||||||
await gameEvent.Origin.Tell(_translationLookup["COMMANDS_READ_MESSAGE_SUCCESS"]
|
var header = _translationLookup["COMMANDS_READ_MESSAGE_SUCCESS"]
|
||||||
.FormatExt($"{index}/{inboxItems.Count}", inboxItem.SourceClient.CurrentAlias.Name))
|
.FormatExt($"{index + 1}/{inboxItems.Count}", inboxItem.SourceClient.CurrentAlias.Name);
|
||||||
.WaitAsync();
|
|
||||||
|
|
||||||
foreach (var messageFragment in inboxItem.Message.FragmentMessageForDisplay())
|
return new[] { header }.Union(inboxItem.Message.FragmentMessageForDisplay());
|
||||||
{
|
}).SelectMany(item => item));
|
||||||
await gameEvent.Origin.Tell(messageFragment).WaitAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
index++;
|
|
||||||
}
|
|
||||||
|
|
||||||
inboxItems.ForEach(item => { item.IsDelivered = true; });
|
inboxItems.ForEach(item => { item.IsDelivered = true; });
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user