use of io.github.jdiscordbots.command_framework.CommandFramework in project Me-e--bypasser by JDiscordBots.
the class MeeBypasser method main.
public static void main(String[] args) {
File tokenFile = new File(".token");
if (tokenFile.exists()) {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(tokenFile), StandardCharsets.UTF_8))) {
final DefaultShardManagerBuilder builder = DefaultShardManagerBuilder.createLight(reader.readLine(), GatewayIntent.getIntents(GatewayIntent.DEFAULT)).setAutoReconnect(true).setStatus(OnlineStatus.ONLINE).setActivity(Activity.watching("https://github.com/JDiscordBots/Mee6-bypasser")).setRequestTimeoutRetry(true);
MessageAction.setDefaultMentions(Collections.emptySet());
CommandFramework framework = new CommandFramework();
framework.setSlashCommandsPerGuild(true);
framework.setPrefix("mb!");
builder.addEventListeners(framework.build(), new MsgListener());
ShardManager manager = builder.build();
for (JDA jda : manager.getShards()) {
jda.awaitReady();
}
} catch (LoginException | IOException e) {
LOG.error("Cannot initialize bot", e);
} catch (InterruptedException e) {
LOG.warn("The main thread was interruped while waiting for a shard to connect initially", e);
Thread.currentThread().interrupt();
}
} else {
try {
Files.createFile(tokenFile.toPath());
} catch (IOException e) {
LOG.error("Cannot create token file.", e);
}
}
}
Aggregations