-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add online players in game notifications (#7)
- Loading branch information
Showing
6 changed files
with
86 additions
and
56 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
23 changes: 21 additions & 2 deletions
23
.../plugin/src/main/kotlin/com/imedvedev/minecraft/notification/bot/NotificationBotPlugin.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 |
---|---|---|
@@ -1,8 +1,27 @@ | ||
package com.imedvedev.minecraft.notification.bot | ||
|
||
import com.imedvedev.minecraft.notification.bot.injector.get | ||
import com.imedvedev.minecraft.notification.bot.injector.module.notificationEventListenerModule | ||
import com.imedvedev.minecraft.notification.bot.injector.module.proxyModule | ||
import com.imedvedev.minecraft.notification.bot.injector.module.telegramMessengerModule | ||
import com.imedvedev.minecraft.notification.bot.messenger.Messenger | ||
import org.bukkit.plugin.Plugin | ||
import org.bukkit.plugin.java.JavaPlugin | ||
import org.koin.core.context.startKoin | ||
import org.koin.dsl.module | ||
|
||
class NotificationBotPlugin : JavaPlugin() { | ||
override fun onEnable() = server.pluginManager.registerEvents(get(this), this) | ||
override fun onEnable() { | ||
val koin = startKoin { modules(listOf( | ||
module(true) { single<Plugin> { this@NotificationBotPlugin } }, | ||
proxyModule, | ||
telegramMessengerModule, | ||
notificationEventListenerModule | ||
)) }.koin | ||
|
||
config.getConfigurationSection("message")!!.getString("started").let { | ||
koin.get<Messenger>().send("<b>$it</b>\n${description.name}: ${description.version}") | ||
} | ||
|
||
server.pluginManager.registerEvents(koin.get(), this) | ||
} | ||
} |
21 changes: 0 additions & 21 deletions
21
modules/plugin/src/main/kotlin/com/imedvedev/minecraft/notification/bot/injector/Injector.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