async Task PaginateAsync(IPaginationRequest p, DiscordEmoji emoji) { var emojis = await p.GetEmojisAsync(); var msg = await p.GetMessageAsync(); if (emoji == emojis.SkipLeft) { await p.SkipLeftAsync(); } else if (emoji == emojis.Left) { await p.PreviousPageAsync(); } else if (emoji == emojis.Right) { await p.NextPageAsync(); } else if (emoji == emojis.SkipRight) { await p.SkipRightAsync(); } else if (emoji == emojis.Stop) { var tcs = await p.GetTaskCompletionSourceAsync(); tcs.TrySetResult(true); return; } var page = await p.GetPageAsync(); await msg.ModifyAsync(page.Content, page.Embed); }
async Task PaginateAsync(IPaginationRequest p, DiscordEmoji emoji) { var emojis = await p.GetEmojisAsync().ConfigureAwait(false); var msg = await p.GetMessageAsync().ConfigureAwait(false); if (emoji == emojis.SkipLeft) { await p.SkipLeftAsync().ConfigureAwait(false); } else if (emoji == emojis.Left) { await p.PreviousPageAsync().ConfigureAwait(false); } else if (emoji == emojis.Right) { await p.NextPageAsync().ConfigureAwait(false); } else if (emoji == emojis.SkipRight) { await p.SkipRightAsync().ConfigureAwait(false); } else if (emoji == emojis.Stop) { var tcs = await p.GetTaskCompletionSourceAsync().ConfigureAwait(false); tcs.TrySetResult(true); return; } var page = await p.GetPageAsync().ConfigureAwait(false); var builder = new DiscordMessageBuilder() .WithContent(page.Content) .WithEmbed(page.Embed); await builder.ModifyAsync(msg).ConfigureAwait(false); }