-
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 Gallery of Dreams Discord bot, allow adding fan arts to the galle…
…ry via the "/galleryofdreams" command
- Loading branch information
1 parent
b194b50
commit de7e497
Showing
45 changed files
with
1,956 additions
and
11 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
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
9 changes: 8 additions & 1 deletion
9
...c/main/kotlin/net/perfectdreams/galleryofdreams/backend/GalleryOfDreamsBackendLauncher.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,18 +1,25 @@ | ||
package net.perfectdreams.galleryofdreams.backend | ||
|
||
import com.typesafe.config.ConfigFactory | ||
import kotlinx.serialization.hocon.Hocon | ||
import kotlinx.serialization.hocon.decodeFromConfig | ||
import net.perfectdreams.galleryofdreams.backend.config.GalleryOfDreamsConfig | ||
import net.perfectdreams.galleryofdreams.backend.utils.LanguageManager | ||
import java.io.File | ||
|
||
object GalleryOfDreamsBackendLauncher { | ||
@JvmStatic | ||
fun main(args: Array<String>) { | ||
val config = Hocon.decodeFromConfig<GalleryOfDreamsConfig>(ConfigFactory.parseString(File("gallery-of-dreams.conf").readText(Charsets.UTF_8)).resolve()) | ||
|
||
val languageManager = LanguageManager( | ||
GalleryOfDreamsBackend::class, | ||
"en", | ||
"/languages/" | ||
) | ||
languageManager.loadLanguagesAndContexts() | ||
|
||
val m = GalleryOfDreamsBackend(languageManager) | ||
val m = GalleryOfDreamsBackend(config, languageManager) | ||
m.start() | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...src/main/kotlin/net/perfectdreams/galleryofdreams/backend/config/GalleryOfDreamsConfig.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,20 @@ | ||
package net.perfectdreams.galleryofdreams.backend.config | ||
|
||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class GalleryOfDreamsConfig( | ||
val discord: DiscordConfig, | ||
val etherealGambi: EtherealGambiConfig | ||
) { | ||
@Serializable | ||
data class DiscordConfig( | ||
val token: String | ||
) | ||
|
||
@Serializable | ||
data class EtherealGambiConfig( | ||
val authorizationToken: String, | ||
val url: String | ||
) | ||
} |
Oops, something went wrong.