public static async Task AddToQueueAsync(this SocketCommandContext Context, OrderRequest <Item> itemReq, string player, SocketUser trader) { IUserMessage test; try { const string helper = "I've added you to the queue! I'll message you here when your order is ready"; test = await trader.SendMessageAsync(helper).ConfigureAwait(false); } catch (HttpException ex) { await Context.Channel.SendMessageAsync($"{ex.HttpCode}: {ex.Reason}!").ConfigureAwait(false); var noAccessMsg = Context.User == trader ? "You must enable private messages in order to be queued!" : $"{player} must enable private messages in order for them to be queued!"; await Context.Channel.SendMessageAsync(noAccessMsg).ConfigureAwait(false); return; } // Try adding var result = Context.AttemptAddToQueue(itemReq, trader, out var msg); // Notify in channel await Context.Channel.SendMessageAsync(msg).ConfigureAwait(false); // Notify in PM to mirror what is said in the channel. await trader.SendMessageAsync(msg).ConfigureAwait(false); // Clean Up if (result) { // Delete the user's join message for privacy if (!Context.IsPrivate) { await Context.Message.DeleteAsync(RequestOptions.Default).ConfigureAwait(false); } } else { // Delete our "I'm adding you!", and send the same message that we sent to the general channel. await test.DeleteAsync().ConfigureAwait(false); } }