You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
package main
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
"io/ioutil"
|
|
)
|
|
|
|
//Config stores the data from json twitterConfig.json file
|
|
type Config struct {
|
|
TelegramBotToken string `json:"telegramBotToken"`
|
|
}
|
|
|
|
var config Config
|
|
|
|
func readConfig() {
|
|
file, e := ioutil.ReadFile("config.json")
|
|
if e != nil {
|
|
fmt.Println("error:", e)
|
|
}
|
|
content := string(file)
|
|
json.Unmarshal([]byte(content), &config)
|
|
fmt.Println("config.json read comlete, Telegram bot ready")
|
|
|
|
}
|