All Downloads are FREE. Search and download functionalities are using the official Maven repository.

discord4j.connect.ExampleSingleWithConnection Maven / Gradle / Ivy

There is a newer version: 0.6.8
Show newest version
package discord4j.connect;

import discord4j.connect.support.BotSupport;
import discord4j.core.DiscordClientBuilder;
import discord4j.core.shard.InvalidationStrategy;
import discord4j.core.shard.ShardingStrategy;
import discord4j.store.jdk.JdkStoreService;

public class ExampleSingleWithConnection {

    public static void main(String[] args) {
        DiscordClientBuilder.create(System.getenv("token"))
                .build()
                .gateway()
                .setStoreService(new JdkStoreService())
                .setInvalidationStrategy(InvalidationStrategy.disable())
                .setSharding(ShardingStrategy.fixed(1))
                .withGateway(client -> BotSupport.create(client).eventHandlers())
                .block();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy