Adding for guildId
This commit is contained in:
parent
462a67e252
commit
344871d392
@ -141,17 +141,15 @@ namespace ChaosBot.Discord.Modules
|
||||
List<Raffle> raffles = new List<Raffle>();
|
||||
|
||||
for (int i = 0; i < amount; i++)
|
||||
raffles.Add(new Raffle(userId.ToString()));
|
||||
raffles.Add(new Raffle(userId.ToString(), Context.Guild.Id.ToString()));
|
||||
|
||||
RaffleRepository.MassInsert(raffles);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
RaffleRepository.Insert(new Raffle(userId.ToString()));
|
||||
RaffleRepository.Insert(new Raffle(userId.ToString(), Context.Guild.Id.ToString()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
sb.AppendLine($"{Context.User.Mention} has added {amount} rafflepoints to <@{userId}>.");
|
||||
sb.AppendLine();
|
||||
sb.AppendLine($"<@{userId}> now has {RaffleRepository.Count(userId.ToString())} rafflepoints!");
|
||||
@ -159,8 +157,8 @@ namespace ChaosBot.Discord.Modules
|
||||
|
||||
private void PickRaffle(StringBuilder sb)
|
||||
{
|
||||
Raffle winner = RaffleRepository.PickRandom();
|
||||
RaffleRepository.Delete(winner.id);
|
||||
Raffle winner = RaffleRepository.PickRandom(Context.Guild.Id.ToString());
|
||||
RaffleRepository.Delete(winner.id, Context.Guild.Id.ToString());
|
||||
sb.Append($"<@{winner.userId}> has won the raffle!");
|
||||
}
|
||||
|
||||
@ -168,7 +166,7 @@ namespace ChaosBot.Discord.Modules
|
||||
{
|
||||
int Removed = RaffleRepository.Count();
|
||||
|
||||
RaffleRepository.ClearRaffle();
|
||||
RaffleRepository.ClearRaffle(Context.Guild.Id.ToString());
|
||||
|
||||
sb.AppendLine($"{Context.User.Mention} has cleared all {Removed} rafflepoints");
|
||||
}
|
||||
@ -177,8 +175,8 @@ namespace ChaosBot.Discord.Modules
|
||||
{
|
||||
ulong userId = Convert.ToUInt64(user.Substring(3, user.Length-4));
|
||||
|
||||
sb.AppendLine($"<@{userId}>, you have {RaffleRepository.Count(userId.ToString())} rafflepoints.");
|
||||
sb.AppendLine($"There is a total of {RaffleRepository.Count()} rafflepoints.");
|
||||
sb.AppendLine($"<@{userId}>, you have {RaffleRepository.Count(userId.ToString(), Context.Guild.Id.ToString())} rafflepoints.");
|
||||
sb.AppendLine($"There is a total of {RaffleRepository.Count(Context.Guild.Id.ToString())} rafflepoints.");
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user