Updated Discord4J, fixed token file location
This commit is contained in:
parent
7db8c283f5
commit
45f6cdd39f
2 changed files with 3 additions and 3 deletions
2
pom.xml
2
pom.xml
|
@ -126,7 +126,7 @@
|
|||
<dependency>
|
||||
<groupId>com.github.austinv11</groupId>
|
||||
<artifactId>Discord4j</artifactId>
|
||||
<version>2.6.0</version>
|
||||
<version>2.6.1</version>
|
||||
<!-- <classifier>shaded</classifier> --> <!-- Include this line if you want a shaded jar (all the Discord4J dependencies
|
||||
bundled into one jar) -->
|
||||
</dependency>
|
||||
|
|
|
@ -41,7 +41,7 @@ public class DiscordPlugin extends JavaPlugin implements IListener<ReadyEvent> {
|
|||
lastannouncementtime = Long.parseLong(line);
|
||||
}
|
||||
ClientBuilder cb = new ClientBuilder();
|
||||
cb.withToken(IOUtils.toString(getClass().getResourceAsStream("/Token.txt"), Charsets.UTF_8));
|
||||
cb.withToken(Files.readFirstLine(new File("TBMC", "Token.txt"), StandardCharsets.UTF_8));
|
||||
dc = cb.login();
|
||||
dc.getDispatcher().registerListener(this);
|
||||
} catch (Exception e) {
|
||||
|
@ -55,7 +55,7 @@ public class DiscordPlugin extends JavaPlugin implements IListener<ReadyEvent> {
|
|||
@Override
|
||||
public void handle(ReadyEvent event) {
|
||||
try {
|
||||
channel = event.getClient().getGuilds().get(0).getChannelsByName("bot").get(0);
|
||||
channel = event.getClient().getGuilds().get(0).getChannelByID("209720707188260864"); // bot
|
||||
channel.sendMessage("Minecraft server started up");
|
||||
Runnable r = new Runnable() {
|
||||
public void run() {
|
||||
|
|
Loading…
Reference in a new issue