Skip to content

Commit 6d822a4

Browse files
XeravaxSenither
andauthored
Updated plugin to support JDA v4 (#1)
* Upgraded to JDA4 * Version change * Switch back and upgrade CI version builds * Remove unnecessary config reload * Update plugin version and Ava version requirement Co-authored-by: Codixer <stefano@stefanocoding.me> Co-authored-by: Alexis Tan <alexis@sen-dev.com>
1 parent 5d2fd94 commit 6d822a4

4 files changed

Lines changed: 10 additions & 11 deletions

File tree

build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@ plugins {
66
apply plugin: 'java'
77

88
group 'com.avairebot'
9-
version '1.0'
9+
version '1.1'
1010
description 'Links the status message of the bot to what the bot is playing.'
1111

1212
sourceCompatibility = 1.8
1313
targetCompatibility = 1.8
1414

1515
repositories {
16-
teamcityServer{
16+
teamcityServer {
1717
url = 'http://ci.avairebot.com'
1818
}
1919
}
2020

2121
dependencies {
2222
// This is nice for local development if you want to use a custom build of Ava.
23-
// compileOnly files('./AvaIre.jar')
23+
// compileOnly files('./AvaIre.jar')
2424

25-
// Version 0.9.165
26-
compileOnly tc(buildTypeId: 'Avaire_Build', version: '1', artifactPath: 'AvaIre.jar')
25+
// Version 0.10.15
26+
compileOnly tc(buildTypeId: 'Avaire_Build', version: '60', artifactPath: 'AvaIre.jar')
2727
}

src/main/java/com/avairebot/nowplaying/MusicEventListener.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import com.avairebot.handlers.events.MusicEndedEvent;
55
import com.avairebot.handlers.events.NowPlayingEvent;
66
import com.avairebot.scheduler.tasks.ChangeGameTask;
7-
import net.dv8tion.jda.core.entities.Game;
7+
import net.dv8tion.jda.api.entities.Activity;
88
import org.slf4j.Logger;
99
import org.slf4j.LoggerFactory;
1010

@@ -39,8 +39,8 @@ public void onNowPlaying(NowPlayingEvent event) {
3939
);
4040

4141
ChangeGameTask.hasCustomStatus = true;
42-
plugin.getAvaire().getShardManager().setGame(
43-
Game.listening(event.getSongTitle())
42+
plugin.getAvaire().getShardManager().setActivity(
43+
Activity.listening(event.getSongTitle())
4444
);
4545
}
4646

src/main/java/com/avairebot/nowplaying/NowPlaying.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ public class NowPlaying extends JavaPlugin {
77
@Override
88
public void onEnable() {
99
saveDefaultConfig();
10-
reloadConfig();
1110

1211
registerEventListener(new MusicEventListener(this));
1312
}

src/main/resources/plugin.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: 'NowPlaying'
22
main: 'com.avairebot.nowplaying.NowPlaying'
3-
version: '1.0'
3+
version: '1.1'
44
author: 'Alexis Tan <Senither#0001>'
55
description: 'A simple plugin that links the bots status to the music handler, so people can see what is being played in the bots status messages.'
6-
requires: '0.7.139'
6+
requires: '0.10.15'

0 commit comments

Comments
 (0)