-
Notifications
You must be signed in to change notification settings - Fork 1
/
settings.go
214 lines (203 loc) · 6.61 KB
/
settings.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
package main
import (
"encoding/json"
"io"
"io/ioutil"
"math/rand"
"os"
)
type connectionConfig struct {
Host string `json:"host"`
Port int `json:"port"`
Ssl bool `json:"ssl"`
Nick string `json:"nick"`
NickServPASSWORD string `json:"nickserv_password"`
AutoJoin []string `json:"autojoin"`
}
type clientConfig struct {
AutoConnect []*connectionConfig `json:"autoconnect"`
HideHostnames bool `json:"hidehostnames"`
HideJoinParts bool `json:"hidejoinparts"`
ChatLogsEnabled bool `json:"chatlogs"`
Font string `json:"font"`
FontSize int `json:"fontsize"`
Theme string `json:"theme"`
TimeFormat string `json:"timeformat"`
Version string `json:"version"`
QuitMessage string `json:"quitmessage"`
}
func defaultClientConfig() *clientConfig {
return &clientConfig{
AutoConnect: []*connectionConfig{},
TimeFormat: "15:04",
Version: "chopsuey IRC " + VERSION_STRING + " https://github.com/dayvonjersen/chopsuey",
QuitMessage: quitMessage[rand.Intn(len(quitMessage)-1)],
}
}
func getClientConfig() (*clientConfig, error) {
cfg := defaultClientConfig()
f, err := os.Open("config.json")
defer f.Close()
if err != nil {
return cfg, err
}
b, err := ioutil.ReadAll(f)
if err != nil {
return cfg, err
}
err = json.Unmarshal(b, &cfg)
return cfg, err
}
func writeClientConfig() error {
f, err := os.Create("config.json")
if err == nil {
b, err := json.MarshalIndent(clientCfg, "", " ")
if err != nil {
return err
}
io.WriteString(f, string(b))
f.Close()
}
return err
}
var quitMessage = []string{
"ε=ε=ε=ε=ε=┌(; ・_・)┘",
"ε=ε=┏( >_<)┛",
"ε=ε=ε=┌(๑ʘ∀ʘ)┘",
"ε=ε=ε=ε=┏(; ̄▽ ̄)┛",
"ε=ε=ε=ε=ε=ε=┌(๑ʘ∀ʘ)┘",
"ε=┏(・ω・)┛",
"ε=ε=ε=ε=ε=ε=┌(; ̄◇ ̄)┘",
"三┏ ( ˘ω˘ )┛",
"₍₍ ᕕ(´◓⌓◔)ᕗ⁾⁾",
"ε=┌(;・_・)┘",
"ε=ε=ε=ε=ε=ε=┌( ̄ー ̄)┘",
"└(>ω<。)┐-=≡",
"ε=ε=ε=ε┏(●´Д`●)┛",
"ε=ε=┏( ・_・)┛",
"ᕕ( ◎_◎)ᕗ",
"ε=ε=ε=ε=ε=ε=┏(*´∀`)┛",
"=ε=ε=ε=ε=┌(`;@@)┘",
"┏( ゜)ਊ゜)┛",
"ᕕ(╯°□°)ᕗ",
"・・・・・・・┌|*´∀`|┘",
"ε=┏(*`>ω<)┛",
"===≡≡≡。゚┌(゚´Д`゚)┘゚。",
"┏┃*・д┃┛",
"┗(^o^ )┓三",
"┌(・Σ・)┘≡З",
"ᕕ༼✿•̀︿•́༽ᕗ",
"C= C= C= C= C= C= C= C= C= ┌(;・ω・)┘",
"ε=ε=ε=ε=ε=┌┤ ̄ ̄(●●) ̄ ̄├┘",
"C= C= C= C= C= C= ┌(;・_・)┘ ))●",
"ε===(っ≧ω≦)っ",
"─=≡Σ((( つ•̀ω•́)つ",
"ε=ε=(っ*´□`)っ",
"─=≡Σ(([ ⊐•̀⌂•́]⊐",
"ε=ε=(⊃≧□≦)⊃",
"─=≡Σ((( つ◕ل͜◕)つ",
"───==≡≡ΣΣ((( つºل͜º)つ",
"─=≡Σ((( つ ◕o◕ )つ",
"……..(((((¬ ̄▽ ̄)¬",
"~(((((っ*´_⊃`)っ",
"-=≡Σ(((⊃゚∀゚)つ",
"!!Σ≡≡≡((っ`・Å・)っ",
"!!((((((っ;゚∀゚)っ",
"ε==ε==(っ*`oЗo*)っ",
"≡≡≡(⊃´・Δ・`)⊃",
"(((((っ-_-)っ",
"⊂(‘ω’⊂ )))Σ≡=─༄༅༄༅༄༅༄༅༄༅",
"ε=ε=ε=ε=ε=ε=ε=ε= ━( ^O^)━",
"⌒⌒ ⌒ “⊂( っ☉ω☉)っ",
"!(∩ω)⊃ —==三 ⊂⌒っ´ㅅ)っ",
"⊂=⊂=⊂(┛゚Θ゚)┛",
"ε-ε-ヾ(o´∀)ノ",
"ε=(。ノ・ω・)ノ",
"ε=ε=ε=(#`・д・)/",
"ε=ε=(ノ≧∇≦)ノ",
"ε=ε=ヾ((●・ω・)ノ",
"٩(•౪•٩)三",
"☆ヾ(・ε・*)ノ゙ =з=з=з",
"ε=(ノo`・∀・)ノ",
"ヾ(・c_,・。) ノ =з =з= з",
"♪ε=ε=ε=ヘ(*≧∇)ノ~",
"ε=ε=ε=(ノ≧∀)ノ",
"ε=ε=ε=ε=ε” “(/*’-‘*)/",
"(=(=(=(=(=(/(エ) ̄)/",
"C= C= C= C=@(/o・ェ・o)@/",
"ε≡(ノ´_ゝ`)ノ",
"☆ミ(o*・ω・)ノ",
"~(((((((っ´Ι`)ノ",
"!!≡≡≡ヘ(*-ω-)ノ",
"ε=ε=ε=(#ノ~ω~)ノ",
"☆⌒v⌒v⌒ヾ((`・∀・´)ノ",
"ε=ε=(((((○´3`)ノ",
"ヾ(Ô‿Ô✾)ノ=з =з",
"– =͟͟͞͞ =͟͟͞͞ ヘ( ´Д`)ノ",
"ε=ε=(怒゚Д゚)ノ",
"ヽ( ̄д ̄;)ノ=3=3=3",
"ε=ε=ε=(۶•̀Д•́)۶",
"ε=ε=ε=(((((ノ`・Д・)ノ",
"(◞º❒º)◞₎₎(◟º❑º)◟⁾⁾➟➠➨",
"ε=٩(●❛ö❛)۶",
"≡≡≡=(ノTдT)ノ",
"..・ヾ(。 ̄□ ̄)ツ",
"⊂(゚Д゚;⊂⌒`つ",
"(c=(c=(c=(c=(゚ロ゚;c=",
"ε=ε=ε=ε=ε=(o- -)o",
"!!Σ(゚Д゚;≡≡≡≡≡ヾ(;゚д゚)/",
"ε=ε=ε=┌(;゚д゚)┘",
"≡┏|*´・Д・|┛",
"ε=ε=εε=ε=ε=( ┯_┯)",
"ε=ε=ε=(ノTдT)ノ",
"~ε~ε~┌(|||´Д`)ノ",
"ε=ε=ε=┏(゚ロ゚;)┛",
"ε=ε=ε=ε=\(;´□`)/",
"C= C= C= C=(o>ロ)o",
"ヽ( ̄д ̄;)ノ=3=3=3",
"ε=ε=ε=ε=(ノ*´Д`)ノ",
"ε=ε=ε=ε=ε=ヾ(;゚ロ゚)ノ",
"ε=ε=ε=ε=ε=(;゚ロ゚)",
"⊂(゚Д゚⊂⌒`つ≡≡≡",
"⌒Y⌒Y⌒ ヾ(o´Д`)ノ",
"ε==ε==(ノ゜д゜)ツ",
"ε=ε=ε=ε=ε=ヾ(;゚(OO)゚)ノ",
"ε=ε=ε=(((怒゚Д゚)ノノ",
"ε=ε=ε=(*ノ´Д`)ノ゚",
"ε=ε=(*ノ´Д`)ノ",
"ヾ( ̄Q ̄ヾ))))ミ~~",
"ε=ε=ε=ヘ(* – -)ノ",
"。。゛(ノ><)ノ",
"レ(゚∀゚;)ヘ=З=З=З",
"ε≡Ξ≡Ξ≡ヽ( ; ̄〇 ̄)ノ",
"ε=(ノ゚д゚)ノ",
"ε=ε=ε=┌(;´゚ェ゚)┘",
"γ⌒γ⌒γ゚・*:.● ⊂(゚ロ゚⊂≡≡===",
"C= C= C= C= C= C= 。・゜゜ヽ| ;∀;|ノ",
"★⌒Y⌒Y⌒Y⌒Y⌒ ヾ(o゚Д゚)ノ",
"===≡≡≡。゜┌(゜ฺДฺ)┘゜。",
"=͟͟͞͞( ∩ ‘ヮ’=͟͟͞͞) ੭ु⁾⁾",
"=͟͟͞͞=͟͟͞͞ ⊂(=͟͟͞͞=͟͟͞͞っ☉ω=͟͟͞͞☉)っ=͟͟͞͞",
"=͟͟͞͞(꒪ᗜ꒪ ‧̣̥̇)!!!!=͟͟͞͞",
"=͟͟͞͞( ๑⃙⃘°◊°๑⃙⃘ )",
"῍̩̖̬ ̎ ̎=͟͟͞͞(꒪ͦ॓ ˈ̫̮ ꒪ͦ॔)=͟͟͞͞८ಯು✧",
"=͟͟͞͞(๑•̀ㅁ•́ฅ✧",
"┗=͟͟͞͞( ˙∀˙)=͟͟͞͞┛",
"(ृ°͈꒳°͈ ृ =͟͟͞͞)ु≡:*・.*",
"=͟͟͞͞( •̀д•́)))",
"ਭ३౽=͟͟͞͞(((ഽʻ⁸ʻ)ഽ",
"=͟͟͞͞( ω )=͟͟͞͞ ³ ³",
"三=͟͟͞͞( ∩ ‘ヮ’=͟͟͞͞) ੭ु⁾⁾",
"=͟͟͞͞ (০͂ ̵̻০͂)ԓ",
"=͟͟͞͞≠⌓̈⃝\\ᵒᵐᵍ",
"一二三☞ ´◔‿ゝ◔ `)☞",
"─=≡Σ((((͡◔ ͜ʖ ͡◔)",
"─=≡Σ((((ó ì_í)=ó",
"三三三ʅ(;◔౪◔)ʃ",
"૮(”ړ ა)͞=͟͟͞͞=͟͟͞͞=͟͟͞͞=͟͟͞͞=͟͟͞͞=͟͟͞͞ #",
"ΣΣ≡≡≡ー(ー・ω・)ー",
"「(◔ω◔「)三",
"「(⑅◔ω◔「)三",
"(’ω’ ⊃)⊃三二一",
"ε=ε=ε=ε=ε=ε= ◟( ͈ω̤)◞",
}