public async Task BankruptcyAsync() { await ReplyAsync($"Are you sure you want to proceed with bankruptcy {Context.Message.Author.Mention}? \n Type **Y** to confirm"); //Get response var response = await NextMessageAsync(); if (response.ToString().ToLower() == "y") { try { //Delete user profile UserCreditsHandler.SetCredits(Context, 0); UserDebtHandler.SetDebt(Context, 0); //Delete user stocks File.Delete(CoreMethod.GetFileLocation(@"\UserStocks") + $@"\{Context.Message.Author.Id}.xml"); //Send final confirmation await ReplyAsync($"It's all over now {Context.Message.Author.Mention}"); } catch (Exception) { } } else { await ReplyAsync($"Bankruptcy request cancelled {Context.Message.Author.Mention}"); } }
public async Task BorrowCreditsAsync(long amount) { await UserDebtHandler.BorrowCredits(Context, amount); }
public async Task ReturnCreditsAsync(long amount) { await UserDebtHandler.ReturnCredits(Context, amount); }
public async Task GetBorrowedCreditsAsync() { long creditsOwed = UserDebtHandler.GetUserCreditsDebt(Context); await Context.Message.Channel.SendMessageAsync(UserInteraction.BoldUserName(Context) + $", you owe **{creditsOwed} Credits**"); }