This commit is contained in:
Ubuntu 2023-02-24 17:03:38 +08:00
parent 00ebfa2be8
commit d3f35f2c53
3 changed files with 9 additions and 0 deletions

View File

@ -13,6 +13,7 @@ import (
)
func StartTelegramBot() {
log.Info("Start Telegram Bot")
telegramKey := config.GetTelegram()
if telegramKey == nil {
log.Info("未找到tg token,不启动tg tot")

View File

@ -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

View File

@ -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("程序退出")
}