use of de.tectoast.emolga.utils.Constants.MYSERVER in project Emolga by TecToast.
the class EmolgaMain method start.
public static void start() throws Exception {
emolgajda = JDABuilder.createDefault(Command.tokens.getString("discord")).enableIntents(GatewayIntent.GUILD_MEMBERS, GatewayIntent.GUILD_PRESENCES).addEventListeners(new EmolgaListener(), messageWaiter).setMemberCachePolicy(MemberCachePolicy.ALL).build();
emolgajda.addEventListener(new SlashListener(emolgajda));
flegmonjda = JDABuilder.createDefault(Command.tokens.getString("discordflegmon")).enableIntents(GatewayIntent.GUILD_MEMBERS, GatewayIntent.GUILD_PRESENCES).addEventListeners(new EmolgaListener(), messageWaiter).setMemberCachePolicy(MemberCachePolicy.ALL).build();
flegmonjda.addEventListener(new SlashListener(emolgajda));
emolgajda.awaitReady();
flegmonjda.awaitReady();
setupJetty();
Guild g = emolgajda.getGuildById(MYSERVER);
g.updateCommands().addCommands(commands.values().stream().filter(Command::isSlash).map(c -> {
CommandData dt = new CommandData(c.getName(), c.getHelp());
List<ArgumentManagerTemplate.Argument> args = c.getArgumentTemplate().arguments;
for (ArgumentManagerTemplate.Argument arg : args) {
dt.addOption(arg.getType().asOptionType(), arg.getName().toLowerCase(), arg.getHelp(), !arg.isOptional());
}
return dt;
}).toArray(CommandData[]::new)).queue();
awaitNextDay();
flegmonjda.getPresence().setActivity(Activity.playing("mit seiner Rute"));
updatePresence();
ReactionManager manager = new ReactionManager(emolgajda);
manager.registerReaction("715249205186265178", "813025531779743774", "813025179114405898", "719928482544484352").registerReaction("715249205186265178", "813025531779743774", "813025403098628097", "813005659619590184").registerReaction("715249205186265178", "813025531779743774", "813025709232488480", "813027599743713320").registerReaction("540899923789611018", "820784528888561715", "820781668586618901", "820783085976420372").registerReaction("830146866812420116", "830391184459300915", "540969934457667613", "830392346348355594").registerReaction("827608009571958806", "884567614918111233", "884564674744561684", "884565654227812364").registerReaction("827608009571958806", "884567614918111233", "884564533295869962", "884565697479458826").registerReaction("827608009571958806", "884567614918111233", "884565288564195348", "884565609663320086").registerReaction("827608009571958806", "884567614918111233", "886748333484441650", "886746672120606771").registerReaction("827608009571958806", "884567614918111233", "886748333484441650", "886746672120606771").registerReaction("827608009571958806", "884567614918111233", "921389285188440115", "921387730200584222");
ScheduledExecutorService giveawayscheduler = new ScheduledThreadPoolExecutor(5);
HashMap<Long, ScheduledFuture<?>> giveawayFutures = new HashMap<>();
DBManagers.GIVEAWAY.forAll(r -> new Giveaway(r.getLong("channelid"), r.getLong("hostid"), r.getTimestamp("end").toInstant(), r.getInt("winners"), r.getString("prize"), r.getLong("messageid")));
}
Aggregations