[AB-200] fixing link embeds not working for users who left the server

fixing some issues with optional dependencies (autowired creates null instances etc)
fixing roll and roulette using not the proper default values
fixing setPrefix not creating an instance, in case it originated from a default config
fixing too many configuration properties in utility
This commit is contained in:
Sheldan
2021-03-16 01:18:31 +01:00
parent 94d6497995
commit cfe7786d4d
15 changed files with 87 additions and 84 deletions

View File

@@ -42,7 +42,7 @@ public class Roll extends AbstractConditionableCommand {
@Override
public CompletableFuture<CommandResult> executeAsync(CommandContext commandContext) {
List<Object> parameters = commandContext.getParameters().getParameters();
Integer high = configService.getLongValue(EntertainmentFeature.ROLL_DEFAULT_HIGH_KEY, commandContext.getGuild().getIdLong()).intValue();
Integer high = configService.getLongValueOrConfigDefault(EntertainmentFeature.ROLL_DEFAULT_HIGH_KEY, commandContext.getGuild().getIdLong()).intValue();
Integer low = 1;
if(parameters.size() > 1) {
low = (Integer) parameters.get(1);

View File

@@ -45,7 +45,7 @@ public class EntertainmentServiceBean implements EntertainmentService {
@Override
public boolean executeRoulette(Member memberExecuting) {
Long possibilities = configService.getLongValue(EntertainmentFeature.ROULETTE_BULLETS_CONFIG_KEY, memberExecuting.getGuild().getIdLong());
Long possibilities = configService.getLongValueOrConfigDefault(EntertainmentFeature.ROULETTE_BULLETS_CONFIG_KEY, memberExecuting.getGuild().getIdLong());
// 1/possibilities of chance, we don't have a state, each time its reset
return secureRandom.nextInt(possibilities.intValue()) == 0;
}