public async Task GetReservasAsync() { try { using (Context.Channel.EnterTypingState()) { BcraResponse result = await BcraService.GetReserves(); if (result != null) { EmbedBuilder embed = await BcraService.CreateReservesEmbedAsync(result); embed.AddCommandDeprecationNotice(Configuration); await ReplyAsync(embed : embed.Build()); } else { await ReplyAsync(REQUEST_ERROR_MESSAGE); } } } catch (Exception ex) { await SendErrorReply(ex); } }
public async Task GetReservasAsync() { await DeferAsync().ContinueWith(async(task) => { try { BcraResponse result = await BcraService.GetReserves(); if (result != null) { EmbedBuilder embed = await BcraService.CreateReservesEmbedAsync(result); await SendDeferredEmbedAsync(embed.Build()); } else { await SendDeferredApiErrorResponseAsync(); } } catch (Exception ex) { await SendDeferredErrorResponseAsync(ex); } }); }