mirror of
https://github.com/RPCS3/discord-bot.git
synced 2024-11-27 04:00:34 +00:00
when compat api lookup has only one result, use embed
This commit is contained in:
parent
09f25173e6
commit
92c1db42e5
@ -240,8 +240,11 @@ Example usage:
|
||||
await Task.Delay(5_000).ConfigureAwait(false);
|
||||
#endif
|
||||
var channel = await ctx.GetChannelForSpamAsync().ConfigureAwait(false);
|
||||
foreach (var msg in FormatSearchResults(ctx, result))
|
||||
await channel.SendAutosplitMessageAsync(msg, blockStart:"", blockEnd:"").ConfigureAwait(false);
|
||||
if (result.Results.Count == 1)
|
||||
await ProductCodeLookup.LookupAndPostProductCodeEmbedAsync(ctx.Client, ctx.Message, new List<string>(result.Results.Keys)).ConfigureAwait(false);
|
||||
else
|
||||
foreach (var msg in FormatSearchResults(ctx, result))
|
||||
await channel.SendAutosplitMessageAsync(msg, blockStart: "", blockEnd: "").ConfigureAwait(false);
|
||||
}
|
||||
|
||||
private IEnumerable<string> FormatSearchResults(CommandContext ctx, CompatResult compatResult)
|
||||
|
Loading…
Reference in New Issue
Block a user