private async Task BuildProgressTrackerPostAsync(ChallengeRank cr, string ThingToTrack, IUserMessage messageToEdit = null) { if (messageToEdit == null) { var tracker = new ProgressTracker(cr, ThingToTrack); messageToEdit = ReplyAsync(embed: tracker.BuildEmbed()).Result; } else { var tracker = new ProgressTracker(messageToEdit, cr); await messageToEdit.ModifyAsync(msg => { msg.Content = string.Empty; msg.Embed = tracker.BuildEmbed(); }); } await messageToEdit.RemoveAllReactionsAsync(); _ = Task.Run(async() => { await messageToEdit.AddReactionAsync(new Emoji(DecreaseEmoji)); await messageToEdit.AddReactionAsync(new Emoji(IncreaseEmoji)); await messageToEdit.AddReactionAsync(new Emoji(FullEmoji)); await messageToEdit.AddReactionAsync(new Emoji(RollEmoji)); }).ConfigureAwait(false); return; }
private void IncreaseProgressFullCheck(IUserMessage message) { ProgressTracker tracker = new ProgressTracker(message); tracker.Ticks += 4; message.ModifyAsync(msg => msg.Embed = tracker.BuildEmbed()).ConfigureAwait(false); }
private void DecreaseProgress(IUserMessage message) { ProgressTracker tracker = new ProgressTracker(message); tracker.RemoveProgress(); message.ModifyAsync(msg => msg.Embed = tracker.BuildEmbed()).ConfigureAwait(false); }