-
Notifications
You must be signed in to change notification settings - Fork 1
/
LaunchBot.kt
69 lines (62 loc) · 2.36 KB
/
LaunchBot.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package fr.delphes
import fr.delphes.bot.Bot
import fr.delphes.bot.Ngrok
import fr.delphes.bot.configuration.BotConfiguration
import fr.delphes.configuration.channel.delphes99.Delphes99Rewards
import fr.delphes.configuration.channel.delphes99.delphes99Channel
import fr.delphes.configuration.channel.delphes99.delphes99CustomFeatures
import fr.delphes.configuration.channel.delphes99.delphes99Features
import fr.delphes.configuration.channel.delphestest.delphestestChannel
import fr.delphes.configuration.channel.delphestest.delphestestCustomFeatures
import fr.delphes.configuration.loadProperties
import fr.delphes.connector.discord.DiscordInitializer
import fr.delphes.connector.obs.ObsInitializer
import fr.delphes.connector.twitch.TwitchInitializer
import fr.delphes.feature.FeatureConfigurationBuilderRegistry
import fr.delphes.feature.FeatureConfigurationType
import fr.delphes.features.featureSerializersModule
import fr.delphes.features.generated.dynamicForm.featuresDynamicFormRegistry
import fr.delphes.features.twitch.command.CustomCommandConfiguration
import fr.delphes.overlay.OverlayInitializer
import kotlinx.serialization.InternalSerializationApi
import java.io.File
@InternalSerializationApi
fun main() {
val props = loadProperties("configuration-pythiebot.properties")
Ngrok.launch(props.getProperty("ngrok.path"))
val tunnel = Ngrok.createHttpTunnel(80, props.getProperty("ngrok.tunnel.name"))
val configFilepath = "A:${File.separator}pythiebot"
val connectors = listOf(
DiscordInitializer(),
ObsInitializer(),
TwitchInitializer(
listOf(
delphes99Channel,
delphestestChannel
),
Delphes99Rewards.configuredRewards
),
OverlayInitializer(),
)
val configuration = BotConfiguration(
configFilepath,
tunnel.publicUrl,
)
Bot.launchBot(
configuration,
connectors,
listOf(
delphes99Features,
).flatten(),
delphes99CustomFeatures + delphestestCustomFeatures,
listOf(
FeatureConfigurationBuilderRegistry(
FeatureConfigurationType("TwitchCustomCommandConfiguration")
) { featureId ->
CustomCommandConfiguration(id = featureId)
},
),
featuresDynamicFormRegistry,
featureSerializersModule
)
}