#HERE
1 messages · Page 1 of 1 (latest)
.
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
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
why wouldnt you shade it
he tries but he is too newbie
sadly i deleted my discord bot project
it was on PC drive
ive got mine up lol
just found my pom
this helped
send any errors you've got @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();
}
}
}
}```
jetbrains annotations 💩
send the full class on https://paste.md-5.net/
@covert sonnet Thank you, i handled it.