made servers configurable

This commit is contained in:
A_D 2018-11-18 17:35:11 +02:00
parent d8d8afd94a
commit e110560515
No known key found for this signature in database
GPG Key ID: C242F3DD220FA945
3 changed files with 16 additions and 9 deletions

View File

@ -5,6 +5,9 @@
"nick": "ADGitea",
"ident": "gitea",
"realname": "gitea",
"server_host": "irc.snoonet.org",
"server_port": "6697",
"ssl": true,
"ns_nick": "",
"ns_passwd": "",
"chans_to_join": [

View File

@ -7,14 +7,18 @@ import (
)
type Config struct {
Secret string `json:"secret"`
BindHost string `json:"bind_host"`
BindPort string `json:"bind_port"`
Nick string `json:"nick"`
Ident string `json:"ident"`
Realname string `json:"realname"`
NsNick string `json:"ns_nick"`
NsPasswd string `json:"ns_passwd"`
Secret string `json:"secret"`
BindHost string `json:"bind_host"`
BindPort string `json:"bind_port"`
ServerHost string `json:"server_host"`
ServerPort string `json:"server_port"`
ServerSSL bool `json:"server_ssl"`
ServerName string `json:"server_name"`
Nick string `json:"nick"`
Ident string `json:"ident"`
Realname string `json:"realname"`
NsNick string `json:"ns_nick"`
NsPasswd string `json:"ns_passwd"`
ChansToJoin []string `json:"chans_to_join"`
}

View File

@ -21,7 +21,7 @@ func main() {
MsgChan: msgChan,
}
bot := newBot(bc, "chimera.snoonet.org", "6697", "snoonet", true)
bot := newBot(bc, config.ServerHost, config.ServerPort, config.ServerName, config.ServerSSL)
go bot.run()
ListenForWebHook(config, msgChan)