update
This commit is contained in:
parent
00ebfa2be8
commit
d3f35f2c53
@ -13,6 +13,7 @@ import (
|
||||
)
|
||||
|
||||
func StartTelegramBot() {
|
||||
log.Info("Start Telegram Bot")
|
||||
telegramKey := config.GetTelegram()
|
||||
if telegramKey == nil {
|
||||
log.Info("未找到tg token,不启动tg tot")
|
||||
|
@ -10,6 +10,7 @@ import (
|
||||
)
|
||||
|
||||
func StartWebChat() {
|
||||
log.Info("Start WebChat Bot")
|
||||
bot := openwechat.DefaultBot(openwechat.Desktop)
|
||||
bot.MessageHandler = wechat.Handler
|
||||
bot.UUIDCallback = openwechat.PrintlnQrcodeUrl
|
||||
|
7
main.go
7
main.go
@ -9,6 +9,12 @@ import (
|
||||
|
||||
func main() {
|
||||
log.SetReportCaller(true)
|
||||
log.SetFormatter(&log.TextFormatter{
|
||||
DisableColors: false,
|
||||
FullTimestamp: true,
|
||||
})
|
||||
|
||||
log.Info("程序启动")
|
||||
err := config.LoadConfig()
|
||||
if err != nil {
|
||||
log.Warn("没有找到配置文件,尝试读取环境变量")
|
||||
@ -21,4 +27,5 @@ func main() {
|
||||
} else if telegramEnv != nil {
|
||||
bootstrap.StartTelegramBot()
|
||||
}
|
||||
log.Info("程序退出")
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user