2017-12-26 09:57:08 +01:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/Syfaro/finch"
|
2018-10-09 09:18:48 +02:00
|
|
|
"github.com/go-telegram-bot-api/telegram-bot-api/v5"
|
2018-10-05 02:16:19 +02:00
|
|
|
"github.com/sirupsen/logrus"
|
2018-09-17 00:35:20 +02:00
|
|
|
|
2019-04-27 06:18:37 +02:00
|
|
|
"huefox.com/syfaro/telegram-furryimgbot/logger"
|
|
|
|
"huefox.com/syfaro/telegram-furryimgbot/sites"
|
|
|
|
|
2018-08-05 08:47:32 +02:00
|
|
|
_ "huefox.com/syfaro/telegram-furryimgbot/commands/info"
|
2018-08-05 08:29:09 +02:00
|
|
|
_ "huefox.com/syfaro/telegram-furryimgbot/commands/inline"
|
2018-09-13 08:13:23 +02:00
|
|
|
_ "huefox.com/syfaro/telegram-furryimgbot/commands/message"
|
2019-04-27 06:18:37 +02:00
|
|
|
_ "huefox.com/syfaro/telegram-furryimgbot/commands/source"
|
2017-12-26 09:57:08 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2018-10-05 02:16:19 +02:00
|
|
|
f := finch.NewFinch("")
|
|
|
|
|
|
|
|
switch v := f.Config.Get("debug").(type) {
|
|
|
|
case bool:
|
|
|
|
f.API.Debug = v
|
|
|
|
case string:
|
|
|
|
f.API.Debug = v == "true"
|
|
|
|
default:
|
|
|
|
f.API.Debug = false
|
2018-10-04 09:21:22 +02:00
|
|
|
}
|
|
|
|
|
2018-10-06 22:57:51 +02:00
|
|
|
if f.API.Debug {
|
2018-10-05 02:16:19 +02:00
|
|
|
logger.Log.SetLevel(logrus.DebugLevel)
|
2018-10-04 09:21:22 +02:00
|
|
|
} else {
|
2018-10-05 02:16:19 +02:00
|
|
|
logger.Log.SetLevel(logrus.InfoLevel)
|
2018-10-04 09:21:22 +02:00
|
|
|
}
|
2018-09-22 04:07:51 +02:00
|
|
|
|
2018-10-09 09:18:48 +02:00
|
|
|
tgbotapi.SetLogger(logger.Log)
|
|
|
|
|
2018-09-22 04:07:51 +02:00
|
|
|
sites.ConfigureSites(f)
|
2018-09-16 22:54:09 +02:00
|
|
|
|
2017-12-26 09:57:08 +01:00
|
|
|
f.Start()
|
|
|
|
}
|