#HERE

1 messages · Page 1 of 1 (latest)

static kayak
#

.

#
package me.limpeex;

import me.limpeex.commands.LinkCommand;
import me.limpeex.configs.DiscordConfig;
import net.dv8tion.jda.api.JDA;
import net.dv8tion.jda.api.JDABuilder;
import net.dv8tion.jda.api.entities.Activity;
import net.dv8tion.jda.api.requests.GatewayIntent;
import net.dv8tion.jda.api.utils.MemberCachePolicy;
import net.dv8tion.jda.api.utils.cache.CacheFlag;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.IOException;

public class SpigotMain extends JavaPlugin {

    private static SpigotMain main;
    @Override
    public void onEnable() {
        main = this;
        saveDefaultConfig();
        getCommand("link").setExecutor(new LinkCommand());
        try {
            DiscordConfig.createCustomConfig();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (InvalidConfigurationException e) {
            e.printStackTrace();
        }
        JDA bot = JDABuilder.createDefault("").addEventListeners(new DiscordBot()).
                setActivity(Activity.listening("")).enableIntents(GatewayIntent.GUILD_PRESENCES)
                .addEventListeners(new BotCommands()).enableIntents(GatewayIntent.GUILD_PRESENCES).enableCache(CacheFlag.ONLINE_STATUS)
                .enableIntents(GatewayIntent.GUILD_MEMBERS).enableIntents(GatewayIntent.MESSAGE_CONTENT)
                .enableIntents(GatewayIntent.GUILD_MESSAGES).enableIntents(GatewayIntent.GUILD_MESSAGE_TYPING)
                .setMemberCachePolicy(MemberCachePolicy.ALL).build();

    }

    public static SpigotMain plugin() {
        return main;
    }
}
#

@dire shadow

static kayak
#

?paste

covert sonnet
#

i know exactly why that wont work

#

change that to

package me.limpeex;

import me.limpeex.commands.LinkCommand;
import me.limpeex.configs.DiscordConfig;
import net.dv8tion.jda.api.JDA;
import net.dv8tion.jda.api.JDABuilder;
import net.dv8tion.jda.api.entities.Activity;
import net.dv8tion.jda.api.requests.GatewayIntent;
import net.dv8tion.jda.api.utils.MemberCachePolicy;
import net.dv8tion.jda.api.utils.cache.CacheFlag;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.IOException;

public class SpigotMain extends JavaPlugin {

  private JDA discordBot;

    private static SpigotMain main;
    @Override
    public void onEnable() {
        main = this;
        saveDefaultConfig();
        getCommand("link").setExecutor(new LinkCommand());
        try {
            DiscordConfig.createCustomConfig();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (InvalidConfigurationException e) {
            e.printStackTrace();
        }

        try {

          this.discordBot = JDABuilder.createDefault("").addEventListeners(new DiscordBot()).
                  setActivity(Activity.listening("")).enableIntents(GatewayIntent.GUILD_PRESENCES)
                  .addEventListeners(new BotCommands()).enableIntents(GatewayIntent.GUILD_PRESENCES).enableCache(CacheFlag.ONLINE_STATUS)
                  .enableIntents(GatewayIntent.GUILD_MEMBERS).enableIntents(GatewayIntent.MESSAGE_CONTENT)
                  .enableIntents(GatewayIntent.GUILD_MESSAGES).enableIntents(GatewayIntent.GUILD_MESSAGE_TYPING)
                  .setMemberCachePolicy(MemberCachePolicy.ALL).build();
          } catch (LoginException | InterruptedException e) {
            e.printStackTrace();

    }

    public static SpigotMain plugin() {
        return main;
    }

    public JDA getDiscordBot() {
        return discordBot;
    }
}
#

@static kayak

tawny leaf
#

still

#

his error is with non-shaded JDA

covert sonnet
#

why wouldnt you shade it

tawny leaf
#

he tries but he is too newbie

#

sadly i deleted my discord bot project

#

it was on PC drive

covert sonnet
#

ive got mine up lol

tawny leaf
#

So i can't help

#

send him your pom xml

#

if it's a plugin bot

covert sonnet
#

it is, i changed to gradle tho

#

ive prob still got my pom on github

#

ill check

tawny leaf
#

all send him gradle

#

@static kayak switch to gradle

covert sonnet
#

just found my pom

covert sonnet
#

does it work now?

#

it was probably erroring on login'

tawny leaf
#

alr then we fixed shade error

#

but he had another

covert sonnet
#

send any errors you've got @static kayak

tawny leaf
#

his was ClassNotFoundException on JDA when running as plugin

#

But he hasn't sent it

static kayak
#

the event not working somehow

#
 @Override
    public void onMessageReceived(@NotNull MessageReceivedEvent event) {
        User user = event.getAuthor();
        System.out.println("entering");
        for(Player p: Bukkit.getOnlinePlayers()) {
            if(DiscordConfig.getConfig().get(p.getUniqueId().toString() + ".id").equals(event.getMessage().getContentRaw())) {
                System.out.println("entering2");
                DiscordConfig.getConfig().set(p.getUniqueId().toString(),"");
                try {
                    DiscordConfig.saveConfig();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }```
tawny leaf
#

jetbrains annotations 💩

covert sonnet
static kayak
#

no

#

forget token

#

wa't

covert sonnet
#

does it just not run or does it get part way through

#

@static kayak

static kayak
#

@covert sonnet Thank you, i handled it.