Skip to content

Commit

Permalink
In top10 and top10total shows as [User]'s position and such instead o…
Browse files Browse the repository at this point in the history
…f your
  • Loading branch information
Voltstro committed Dec 21, 2019
1 parent c6a6445 commit fffc66f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/Pootis-Bot/Modules/Basic/Basic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ public async Task ServerGuild()
[Cooldown(5)]
public async Task Top10()
{
List<UserAccount> serverUsers = new List<UserAccount>();
foreach (SocketGuildUser user in Context.Guild.Users)
if (!user.IsBot && !user.IsWebhook)
serverUsers.Add(UserAccountsManager.GetAccount(user));
List<UserAccount> serverUsers = (from user in Context.Guild.Users where !user.IsBot && !user.IsWebhook select UserAccountsManager.GetAccount(user)).ToList();

serverUsers.Sort(new SortUserAccount());
serverUsers.Reverse();
Expand All @@ -87,7 +84,7 @@ public async Task Top10()

UserAccount userAccount = UserAccountsManager.GetAccount((SocketGuildUser) Context.User);
format.Append(
$"\n------------------------\n 😊 Your Position: {serverUsers.IndexOf(userAccount) + 1} Your Level: {userAccount.LevelNumber} Your Xp: {userAccount.Xp}```");
$"\n------------------------\n 😊 {Context.User.Username}'s Position: {serverUsers.IndexOf(userAccount) + 1} {Context.User.Username}'s Level: {userAccount.LevelNumber} {Context.User.Username}'s Xp: {userAccount.Xp}```");

await Context.Channel.SendMessageAsync(format.ToString());
}
Expand Down Expand Up @@ -115,7 +112,7 @@ public async Task Top10Total()

UserAccount userAccount = UserAccountsManager.GetAccount((SocketGuildUser) Context.User);
format.Append(
$"\n------------------------\n 😊 Your Position: {totalUsers.IndexOf(userAccount) + 1} Your Level: {userAccount.LevelNumber} Your Xp: {userAccount.Xp}```");
$"\n------------------------\n 😊 {Context.User.Username}'s Position: {totalUsers.IndexOf(userAccount) + 1} {Context.User.Username}'s Level: {userAccount.LevelNumber} {Context.User.Username}'s Xp: {userAccount.Xp}```");

await Context.Channel.SendMessageAsync(format.ToString());
}
Expand Down

0 comments on commit fffc66f

Please sign in to comment.