-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from nicholasgrose/discord_command_cleanup
- Loading branch information
Showing
34 changed files
with
476 additions
and
201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/main/kotlin/com/rose/gateway/config/access/AboutExtensionEnabled.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.rose.gateway.config.access | ||
|
||
import com.rose.gateway.config.PluginConfig | ||
|
||
/** | ||
* Gives whether the about extension is enabled from the plugin config | ||
* | ||
* @return Whether the extension is enabled | ||
*/ | ||
fun PluginConfig.aboutExtensionEnabled(): Boolean { | ||
return config.bot.extensions.about.enabled | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/kotlin/com/rose/gateway/config/access/BotConfiguration.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.rose.gateway.config.access | ||
|
||
import com.rose.gateway.config.PluginConfig | ||
|
||
/** | ||
* Gives the Discord bot token from the plugin config | ||
* | ||
* @return The Discord bot's token | ||
*/ | ||
fun PluginConfig.botToken(): String { | ||
return config.bot.token | ||
} | ||
|
||
/** | ||
* Gives the bot channels from the plugin config | ||
* | ||
* @return The Discord bot's bot channels | ||
*/ | ||
fun PluginConfig.botChannels(): List<String> { | ||
return config.bot.botChannels | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/kotlin/com/rose/gateway/config/access/ChatExtensionEnabled.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.rose.gateway.config.access | ||
|
||
import com.rose.gateway.config.PluginConfig | ||
|
||
/** | ||
* Gives whether the chat extension is enabled from the plugin config | ||
* | ||
* @return Whether the extension is enabled | ||
*/ | ||
fun PluginConfig.chatExtensionEnabled(): Boolean { | ||
return config.bot.extensions.chat.enabled | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/kotlin/com/rose/gateway/config/access/IpExtension.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.rose.gateway.config.access | ||
|
||
import com.rose.gateway.config.PluginConfig | ||
|
||
/** | ||
* Gives whether the ip extension is enabled from the plugin config | ||
* | ||
* @return Whether the extension is enabled | ||
*/ | ||
fun PluginConfig.ipExtensionEnabled(): Boolean { | ||
return config.bot.extensions.ip.enabled | ||
} | ||
|
||
/** | ||
* The IP to display with the IP extension | ||
* | ||
* @return The IP to display | ||
*/ | ||
fun PluginConfig.displayIp(): String { | ||
return config.bot.extensions.ip.displayIp | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/kotlin/com/rose/gateway/config/access/ListExtension.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.rose.gateway.config.access | ||
|
||
import com.rose.gateway.config.PluginConfig | ||
|
||
/** | ||
* Gives whether the list extension is enabled from the plugin config | ||
* | ||
* @return Whether the extension is enabled | ||
*/ | ||
fun PluginConfig.listExtensionEnabled(): Boolean { | ||
return config.bot.extensions.list.enabled | ||
} | ||
|
||
/** | ||
* Gives the maximum number of players that can be displayed on each list page | ||
* | ||
* @return The maximum number of players per page | ||
*/ | ||
fun PluginConfig.maxPlayersPerListPage(): Int { | ||
return config.bot.extensions.list.maxPlayersPerPage | ||
} |
2 changes: 1 addition & 1 deletion
2
...eway/config/extensions/MinecraftConfig.kt → .../gateway/config/access/MinecraftConfig.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/main/kotlin/com/rose/gateway/config/access/TpsExtensionEnabled.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.rose.gateway.config.access | ||
|
||
import com.rose.gateway.config.PluginConfig | ||
|
||
/** | ||
* Gives whether the TPS extension is enabled from the plugin config | ||
* | ||
* @return Whether the extension is enabled | ||
*/ | ||
fun PluginConfig.tpsExtensionEnabled(): Boolean { | ||
return config.bot.extensions.tps.enabled | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/kotlin/com/rose/gateway/config/access/WhitelistExtension.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.rose.gateway.config.access | ||
|
||
import com.rose.gateway.config.PluginConfig | ||
|
||
/** | ||
* Gives whether the whitelist extension is enabled from the plugin config | ||
* | ||
* @return Whether the extension is enabled | ||
*/ | ||
fun PluginConfig.whitelistExtensionEnabled(): Boolean { | ||
return config.bot.extensions.whitelist.enabled | ||
} | ||
|
||
/** | ||
* Gives the maximum number of players that can be displayed on each whitelist page | ||
* | ||
* @return The maximum number of players per page | ||
*/ | ||
fun PluginConfig.maxPlayersPerWhitelistPage(): Int { | ||
return config.bot.extensions.whitelist.maxPlayersPerPage | ||
} |
84 changes: 0 additions & 84 deletions
84
src/main/kotlin/com/rose/gateway/config/extensions/BotConfiguration.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.