Skip to content

Commit

Permalink
[Upgrade] JDAのバージョンを更新
Browse files Browse the repository at this point in the history
・Discord APIの更新に準拠したコードに変更
  • Loading branch information
Aoichaan0513 committed Oct 11, 2020
1 parent c719fff commit 0cf81ba
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 19 deletions.
44 changes: 27 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
buildscript {
ext {
kotlin_version = '1.3.72'
spigot_version = '1.16.1-R0.1-SNAPSHOT'
kotlinVersion = '1.4.0'
kotlinLanguageVersion = '1.4'
kotlinApiVersion = '1.4'
spigotVersion = '1.16.1-R0.1-SNAPSHOT'

javaVersion = JavaVersion.VERSION_1_8
}

repositories {
mavenCentral()
}

dependencies {
classpath group: 'org.jetbrains.kotlin', name: 'kotlin-gradle-plugin', version: kotlin_version
classpath group: 'org.jetbrains.kotlin', name: 'kotlin-gradle-plugin', version: kotlinVersion
}
}

Expand All @@ -20,11 +24,11 @@ plugins {

apply plugin: 'kotlin'

group = pluginGroup
version = pluginVersion
group = 'jp.aoichaan0513'
version = 'Stable-1.1.2'

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = javaVersion
targetCompatibility = javaVersion

repositories {
mavenCentral()
Expand All @@ -43,16 +47,16 @@ repositories {

dependencies {
// Kotlin
implementation group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8', version: kotlin_version
implementation group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: '1.3.2'
implementation group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8', version: kotlinVersion
implementation group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: '1.3.9'
compile group: 'org.jetbrains.kotlin', name: 'kotlin-script-util'

// Minecraft
compile group: 'org.spigotmc', name: 'spigot-api', version: spigot_version
compile group: 'org.spigotmc', name: 'spigot-api', version: spigotVersion
compile group: 'net.luckperms', name: 'api', version: '5.0'

// Bot
compile group: 'net.dv8tion', name: 'JDA', version: '4.2.0_191' //
compile group: 'net.dv8tion', name: 'JDA', version: '4.2.0_208' //

// データ管理用ライブラリ
compile group: 'org.json', name: 'json', version: '20190722'
Expand All @@ -77,21 +81,27 @@ processResources {
}
}

compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

compileKotlin {
kotlinOptions {
jvmTarget = '1.8'
apiVersion = '1.3'
languageVersion = '1.3'
jvmTarget = javaVersion
apiVersion = kotlinLanguageVersion
languageVersion = kotlinApiVersion
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = '1.8'
apiVersion = '1.3'
languageVersion = '1.3'
jvmTarget = javaVersion
apiVersion = kotlinLanguageVersion
languageVersion = kotlinApiVersion
}
}
4 changes: 2 additions & 2 deletions src/main/kotlin/jp/aoichaan0513/fslink/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import jp.aoichaan0513.fslink.Listeners.PlayerListener
import net.dv8tion.jda.api.JDA
import net.dv8tion.jda.api.JDABuilder
import net.dv8tion.jda.api.OnlineStatus
import net.dv8tion.jda.api.requests.GatewayIntent
import net.luckperms.api.LuckPerms
import org.bukkit.Bukkit
import org.bukkit.event.Listener
Expand Down Expand Up @@ -61,8 +62,7 @@ class Main : JavaPlugin() {
}

private fun loadBot() {
botInstance = JDABuilder()
.setToken(config.getString("token"))
botInstance = JDABuilder.create(config.getString("token"), GatewayIntent.GUILD_MESSAGES, GatewayIntent.DIRECT_MESSAGES)
.setStatus(OnlineStatus.ONLINE)
.addEventListeners(BotListener())
.build()
Expand Down

0 comments on commit 0cf81ba

Please sign in to comment.