Skip to content

Instantly share code, notes, and snippets.

@nkomarn
Created February 2, 2019 16:47
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nkomarn/4b437fd54b40fed74b37412f17ebac41 to your computer and use it in GitHub Desktop.
Save nkomarn/4b437fd54b40fed74b37412f17ebac41 to your computer and use it in GitHub Desktop.
An update for the bot tutorial (when using JDA 3.8)!
package techtoolbox.Bot;
import javax.security.auth.login.LoginException;
import net.dv8tion.jda.core.JDABuilder;
import net.dv8tion.jda.core.OnlineStatus;
import net.dv8tion.jda.core.entities.Game;
import techtoolbox.Bot.events.GuildMessageReceived;
public class Bot {
public static String prefix = "~";
public static void main(String[] args) throws LoginException {
JDABuilder builder = new JDABuilder();
builder.setToken("Your token goes here.");
builder.setStatus(OnlineStatus.ONLINE);
builder.setGame(Game.playing("boring comedy shows."));
// Register listeners
builder.addEventListener(new GuildMessageReceived());
builder.build();
}
}
@Matitron
Copy link

Matitron commented Dec 4, 2020

help it says "game string"

@MOMIN5
Copy link

MOMIN5 commented Feb 2, 2021

I got the same as the guy above me :(

when you add JDA as a dependancy make sure you add the one with inbuild dependancies, https://github.com/DV8FromTheWorld/JDA/releases/download/v4.2.0/JDA-4.2.0_168-withDependencies.jar
i have linked it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment