@@ -10,7 +10,14 @@ import (
1010 "github.com/joho/godotenv"
1111)
1212
13+ var (
14+ version = "dev"
15+ commit = "0000"
16+ )
17+
1318func main () {
19+ fmt .Printf ("[jarvis] %s, %s\n " , version , commit )
20+
1421 // Get first argument to determine mode
1522 mode := determineMode ()
1623
@@ -29,13 +36,13 @@ func main() {
2936 log .Printf ("Starting cluster" )
3037 bot := SetupTelegram ()
3138 initializeCluster (bot , mode )
32- case "router " :
33- log .Printf ("Starting router " )
34- bot := SetupTelegram ()
35- initializeRouter (bot , mode )
36- case "node" :
37- log .Printf ("Starting node" )
38- initializeNode (mode )
39+ // case "home ":
40+ // log.Printf("Starting home ")
41+ // bot := SetupTelegram()
42+ // initializeHome (bot, mode)
43+ // case "node":
44+ // log.Printf("Starting node")
45+ // initializeNode(mode)
3946 default :
4047 log .Fatalf ("Invalid mode: %s" , mode )
4148 }
@@ -54,23 +61,23 @@ func initializeCluster(bot *tgbotapi.BotAPI, mode string) {
5461 router .Run (fmt .Sprintf (":%s" , PORT ))
5562}
5663
57- func initializeRouter (bot * tgbotapi.BotAPI , mode string ) {
58- botExtended := & BotExtended {bot }
59- botExtended .SendMessageToPrimaryTelegramGroup ("[narnia initializing]" )
60- SetupTelegramCommandHandler (botExtended , mode )
61- }
64+ // func initializeHome (bot *tgbotapi.BotAPI, mode string) {
65+ // botExtended := &BotExtended{bot}
66+ // botExtended.SendMessageToPrimaryTelegramGroup("[narnia initializing]")
67+ // SetupTelegramCommandHandler(botExtended, mode)
68+ // }
6269
63- func initializeNode (mode string ) {
64- router := NodeRouter ()
70+ // func initializeNode(mode string) {
71+ // router := NodeRouter()
6572
66- PORT := os .Getenv ("PORT" )
67- if PORT == "" {
68- PORT = "4000"
69- }
70- log .Printf ("Serving at http://localhost:%s" , PORT )
71- router .Run (fmt .Sprintf (":%s" , PORT ))
73+ // PORT := os.Getenv("PORT")
74+ // if PORT == "" {
75+ // PORT = "4000"
76+ // }
77+ // log.Printf("Serving at http://localhost:%s", PORT)
78+ // router.Run(fmt.Sprintf(":%s", PORT))
7279
73- }
80+ // }
7481
7582func determineMode () string {
7683 DEFAULT_MODE := "cluster"
0 commit comments