public async Task Praise(SocketUser user, [Remainder] string reason) { GuildCfg guildCfg = GuildsCfgs.GetGuildCfg(Context.Guild); ISocketMessageChannel generalChannel = (ISocketMessageChannel)Methods.GetTextChannelByID(Context.Guild, guildCfg.GeneralChannelID); UserPraises account = UsersPraises.GetUserPraises(user.Id); uint id = (uint)account.Praises.Count; Praise praise = Praises.CreatePraise(user, id, reason); account.Praises.Add(praise); UsersPraises.Save(); await generalChannel.SendMessageAsync($"Użytkownik {user.Mention} otrzymał pochwałę od {Context.User.Username}. Powód: {reason}"); await Context.Channel.SendMessageAsync("Dodano pochwałę."); }
public async Task CheckPraises(SocketUser user = null) { if (user == null) { user = Context.User; } UserPraises account = UsersPraises.GetUserPraises(user.Id); string praises = $"Pochwały {user.Username}:\n"; foreach (Praise praise in account.Praises) { praises += $"{praise.ID} - {praise.Reason} ({praise.GivenAt})\n"; } await Context.Channel.SendMessageAsync(praises); }
public async Task CheckStatus(SocketUser user = null) { if (user == null) { user = Context.User; } UserExpMute userExp = UsersExpMute.GetExpMute(user.Id); UserPraises uPraises = UsersPraises.GetUserPraises(user.Id); UserArchievements uArchievements = UsersArchievements.GetUserArchievements(user.Id); UserWarnings accountWarns = UsersWarnings.GetUserWarnings(user); Methods.DeleteExpiredWarnings(accountWarns); string archievements = "Osiągnięcia:\n"; foreach (string item in uArchievements.Archievements) { archievements += $"{item}\n"; } await Context.Channel.SendMessageAsync($"{user.Username} ma {userExp.LevelNumber} lvl, {userExp.XP} xp. Został pochwalony {uPraises.Praises.Count} razy oraz otrzymał {accountWarns.Warnings.Count} ostrzeżeń.\n{archievements}"); }