Updating due to casting errors because of serialized ConfigRepository data
This commit is contained in:
parent
eaf5ed9889
commit
843e9f4808
@ -120,10 +120,10 @@ namespace ChaosBot.Discord.Modules
|
||||
[Command("raffle buy")]
|
||||
public async Task RaffleCommandBuy(int amount = 1)
|
||||
{
|
||||
int cost = ConfigurationRepository.GetValue<int>($"Raffle:Cost", Context.Guild.Id) * amount;
|
||||
int cost = Convert.ToInt32(ConfigurationRepository.GetValue<string>($"Raffle:Cost", Context.Guild.Id)) * amount;
|
||||
long curPoints = PointsRepository.Total(Convert.ToInt64(Context.User.Id), Convert.ToInt64(Context.Guild.Id));
|
||||
int curRaffle = RaffleRepository.Count(Convert.ToInt64(Context.User.Id), Convert.ToInt64(Context.Guild.Id));
|
||||
int maxRaffle = ConfigurationRepository.GetValue<int>($"Raffle:Max", Context.Guild.Id);
|
||||
int maxRaffle = Convert.ToInt32(ConfigurationRepository.GetValue<string>($"Raffle:Max", Context.Guild.Id));
|
||||
int newRaffle = curRaffle + amount;
|
||||
|
||||
Console.WriteLine($"curPoints: {curPoints}, curRaffle: {curRaffle}, maxRaffle: {maxRaffle}, newRaffle: {newRaffle}");
|
||||
@ -147,7 +147,7 @@ namespace ChaosBot.Discord.Modules
|
||||
else
|
||||
{
|
||||
await ReplyAsync(
|
||||
$"You cannot buy more then {ConfigurationRepository.GetValue<int>($"Raffle:Max", Context.Guild.Id).ToString()} tickets.", false);
|
||||
$"You cannot buy more then {ConfigurationRepository.GetValue<string>($"Raffle:Max", Context.Guild.Id)} tickets.", false);
|
||||
_logger.Warn($"{Context.User.Username} has bought {amount} tickets!");
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user