mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-03-22 13:14:12 +00:00
[AB-63] adding fun and entertainment related commands commands: roll, roulette, lovecalc, choose, 8ball
This commit is contained in:
@@ -274,11 +274,22 @@ public class CommandReceivedHandler extends ListenerAdapter {
|
||||
if(!reminderActive) {
|
||||
parsedParameters.add(value);
|
||||
} else {
|
||||
if(parsedParameters.isEmpty()) {
|
||||
parsedParameters.add(value);
|
||||
if(!param.isListParam()) {
|
||||
if(parsedParameters.isEmpty()) {
|
||||
parsedParameters.add(value);
|
||||
} else {
|
||||
int lastIndex = parsedParameters.size() - 1;
|
||||
parsedParameters.set(lastIndex, parsedParameters.get(lastIndex) + " " + value);
|
||||
}
|
||||
} else {
|
||||
int lastIndex = parsedParameters.size() - 1;
|
||||
parsedParameters.set(lastIndex, parsedParameters.get(lastIndex) + " " + value);
|
||||
if(parsedParameters.isEmpty()) {
|
||||
ArrayList<Object> list = new ArrayList<>();
|
||||
list.add(value);
|
||||
parsedParameters.add(list);
|
||||
} else {
|
||||
int lastIndex = parsedParameters.size() - 1;
|
||||
((List)parsedParameters.get(lastIndex)).add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package dev.sheldan.abstracto.core.config;
|
||||
|
||||
import ch.qos.logback.core.net.ssl.SecureRandomFactoryBean;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.jagrosh.jdautilities.commons.waiter.EventWaiter;
|
||||
@@ -10,6 +11,9 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.NoSuchProviderException;
|
||||
import java.security.SecureRandom;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
@@ -42,4 +46,9 @@ public class CoreConfig {
|
||||
public OkHttpClient client() {
|
||||
return new OkHttpClient();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public SecureRandom secureRandom() throws NoSuchProviderException, NoSuchAlgorithmException {
|
||||
return new SecureRandomFactoryBean().createSecureRandom();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user