diff --git a/build.gradle b/build.gradle index 20a4a78..8fe5672 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ import org.apache.tools.ant.filters.ReplaceTokens buildscript { - ext.kotlin_version = '1.0.0' + ext.kotlin_version = '1.0.5-2' repositories { mavenCentral() @@ -25,7 +25,7 @@ apply plugin: 'kotlin' group = 'gg.obsidian' version = '1.0.1' description = """Use Discourse group as a whitelist""" -ext.url = 'https://github.com/the-obsidian/DiscordBridge' +ext.url = 'https://github.com/the-obsidian/DiscourseBridge' sourceCompatibility = 1.8 targetCompatibility = 1.8 @@ -41,7 +41,7 @@ repositories { } dependencies { - compile group: 'org.spigotmc', name: 'spigot-api', version:'1.8.8-R0.1-SNAPSHOT' + compile group: 'org.spigotmc', name: 'spigot-api', version:'1.11-R0.1-SNAPSHOT' compile group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib', version:'1.0.0-rc-1036' compile group: 'net.dv8tion', name: 'JDA', version:'1.3.0_188' compile group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.2.0' diff --git a/src/main/kotlin/gg/obsidian/discoursewhitelist/Plugin.kt b/src/main/kotlin/gg/obsidian/discoursewhitelist/Plugin.kt index 2cfc602..120013b 100644 --- a/src/main/kotlin/gg/obsidian/discoursewhitelist/Plugin.kt +++ b/src/main/kotlin/gg/obsidian/discoursewhitelist/Plugin.kt @@ -35,8 +35,8 @@ class Plugin : JavaPlugin(), Listener { @EventHandler fun onLogin(e: PlayerLoginEvent) { if (configuration.GROUP_ID != 0) { - val discourdGroups = getDiscordGroupIds(e.player.name) - if (!discourdGroups.contains(configuration.GROUP_ID)) { + val disourseGroups = getDiscourseGroupIds(e.player.name) + if (!disourseGroups.contains(configuration.GROUP_ID)) { val message = ChatColor.translateAlternateColorCodes('&', configuration.MESSAGE) e.disallow(PlayerLoginEvent.Result.KICK_WHITELIST, message) } @@ -53,7 +53,7 @@ class Plugin : JavaPlugin(), Listener { configuration.load() } - private fun getDiscordGroupIds(username: String): Set { + private fun getDiscourseGroupIds(username: String): Set { val url = configuration.DISCOURSE_URL + "/users/" + username + ".json" val request = Request.Builder().url(url).get().build() val response = httpClient.newCall(request).execute()