mc-tgbot/services/handler.go
vaalacat 75944abbc2
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/promote/production Build is passing
feat: gateway
2024-04-23 11:18:16 +00:00

29 lines
462 B
Go

package services
import (
"tg-mc/conf"
"tg-mc/services/gateway"
"tg-mc/services/mc"
"tg-mc/services/tgbot"
)
func Run() {
settings := conf.GetBotSettings()
if settings.EnableGateway {
go gateway.StartGateway()
}
if settings.EnableBridge {
go mc.StartBridgeClient()
}
if settings.EnableBot {
if settings.EnableBridge {
tgbot.Run(mc.SendMsg, mc.SendCommand)
} else {
tgbot.Run(mc.SendMsg, func(s string) error { return nil })
}
}
}