This repository has been archived by the owner on Jul 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
countenance.go
362 lines (357 loc) · 9.7 KB
/
countenance.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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
package OPQBot
import (
"errors"
"fmt"
"regexp"
)
const (
Face_惊讶 = "[表情0]"
Face_撇嘴 = "[表情1]"
Face_色 = "[表情2]"
Face_发呆 = "[表情3]"
Face_得意 = "[表情4]"
Face_流泪 = "[表情5]"
Face_害羞 = "[表情6]"
Face_闭嘴 = "[表情7]"
Face_睡 = "[表情8]"
Face_大哭 = "[表情9]"
Face_尴尬 = "[表情10]"
Face_发怒 = "[表情11]"
Face_调皮 = "[表情12]"
Face_呲牙 = "[表情13]"
Face_微笑 = "[表情14]"
Face_难过 = "[表情15]"
Face_酷 = "[表情16]"
Face_抓狂 = "[表情18]"
Face_吐 = "[表情19]"
Face_偷笑 = "[表情20]"
Face_可爱 = "[表情21]"
Face_白眼 = "[表情22]"
Face_傲慢 = "[表情23]"
Face_饥饿 = "[表情24]"
Face_困 = "[表情25]"
Face_惊恐 = "[表情26]"
Face_流汗 = "[表情27]"
Face_憨笑 = "[表情28]"
Face_悠闲 = "[表情29]"
Face_奋斗 = "[表情30]"
Face_咒骂 = "[表情31]"
Face_疑问 = "[表情32]"
Face_嘘 = "[表情33]"
Face_晕 = "[表情34]"
Face_折磨 = "[表情35]"
Face_衰 = "[表情36]"
Face_骷髅 = "[表情37]"
Face_敲打 = "[表情38]"
Face_再见 = "[表情39]"
Face_发抖 = "[表情41]"
Face_爱情 = "[表情42]"
Face_跳跳 = "[表情43]"
Face_猪头 = "[表情46]"
Face_拥抱 = "[表情49]"
Face_蛋糕 = "[表情53]"
Face_闪电 = "[表情54]"
Face_炸弹 = "[表情55]"
Face_刀 = "[表情56]"
Face_足球 = "[表情57]"
Face_便便 = "[表情59]"
Face_咖啡 = "[表情60]"
Face_饭 = "[表情61]"
Face_玫瑰 = "[表情63]"
Face_凋谢 = "[表情64]"
Face_爱心 = "[表情66]"
Face_心碎 = "[表情67]"
Face_礼物 = "[表情69]"
Face_太阳 = "[表情74]"
Face_月亮 = "[表情75]"
Face_赞 = "[表情76]"
Face_踩 = "[表情77]"
Face_握手 = "[表情78]"
Face_胜利 = "[表情79]"
Face_飞吻 = "[表情82]"
Face_怄火 = "[表情86]"
Face_西瓜 = "[表情89]"
Face_冷汗 = "[表情96]"
Face_擦汗 = "[表情97]"
Face_抠鼻 = "[表情98]"
Face_鼓掌 = "[表情99]"
Face_糗大了 = "[表情100]"
Face_坏笑 = "[表情101]"
Face_左哼哼 = "[表情102]"
Face_右哼哼 = "[表情103]"
Face_哈欠 = "[表情104]"
Face_鄙视 = "[表情105]"
Face_委屈 = "[表情106]"
Face_快哭了 = "[表情107]"
Face_阴险 = "[表情108]"
Face_左亲亲 = "[表情109]"
Face_吓 = "[表情110]"
Face_可怜 = "[表情111]"
Face_菜刀 = "[表情112]"
Face_啤酒 = "[表情113]"
Face_篮球 = "[表情114]"
Face_乒乓 = "[表情115]"
Face_示爱 = "[表情116]"
Face_瓢虫 = "[表情117]"
Face_抱拳 = "[表情118]"
Face_勾引 = "[表情119]"
Face_拳头 = "[表情120]"
Face_差劲 = "[表情121]"
Face_爱你 = "[表情122]"
Face_NO = "[表情123]"
Face_OK = "[表情124]"
Face_转圈 = "[表情125]"
Face_磕头 = "[表情126]"
Face_回头 = "[表情127]"
Face_跳绳 = "[表情128]"
Face_挥手 = "[表情129]"
Face_激动 = "[表情130]"
Face_街舞 = "[表情131]"
Face_献吻 = "[表情132]"
Face_左太极 = "[表情133]"
Face_右太极 = "[表情134]"
Face_双喜 = "[表情136]"
Face_嗨皮牛耶 = "[表情137]"
Face_灯笼 = "[表情138]"
Face_K歌 = "[表情140]"
Face_喝彩 = "[表情144]"
Face_祈祷 = "[表情145]"
Face_爆筋 = "[表情146]"
Face_棒棒糖 = "[表情147]"
Face_喝奶 = "[表情148]"
Face_飞机 = "[表情151]"
Face_钞票 = "[表情158]"
Face_药 = "[表情168]"
Face_手枪 = "[表情169]"
Face_茶 = "[表情171]"
Face_眨眼睛 = "[表情172]"
Face_泪奔 = "[表情173]"
Face_无奈 = "[表情174]"
Face_卖萌 = "[表情175]"
Face_小纠结 = "[表情176]"
Face_喷血 = "[表情177]"
Face_斜眼笑 = "[表情178]"
Face_doge = "[表情179]"
Face_惊喜 = "[表情180]"
Face_骚扰 = "[表情181]"
Face_笑哭 = "[表情182]"
Face_我最美 = "[表情183]"
Face_河蟹 = "[表情184]"
Face_羊驼 = "[表情185]"
Face_幽灵 = "[表情187]"
Face_蛋 = "[表情188]"
Face_菊花 = "[表情190]"
Face_红包 = "[表情192]"
Face_大笑 = "[表情193]"
Face_不开心 = "[表情194]"
Face_冷漠 = "[表情197]"
Face_呃 = "[表情198]"
Face_好棒 = "[表情199]"
Face_拜托 = "[表情200]"
Face_点赞 = "[表情201]"
Face_无聊 = "[表情202]"
Face_托脸 = "[表情203]"
Face_吃 = "[表情204]"
Face_送花 = "[表情205]"
Face_害怕 = "[表情206]"
Face_花痴 = "[表情207]"
Face_小样儿 = "[表情208]"
Face_飙泪 = "[表情210]"
Face_我不看 = "[表情211]"
Face_托腮 = "[表情212]"
Face_啵啵 = "[表情214]"
Face_糊脸 = "[表情215]"
Face_拍头 = "[表情216]"
Face_扯一扯 = "[表情217]"
Face_舔一舔 = "[表情218]"
Face_蹭一蹭 = "[表情219]"
Face_佛系 = "[表情220]"
Face_顶呱呱 = "[表情221]"
Face_加油必胜 = "[表情245]"
Face_加油抱抱 = "[表情246]"
Face_口罩护体 = "[表情247]"
)
var FaceMap = map[string]string{
"[表情0]": "惊讶",
"[表情1]": "撇嘴",
"[表情2]": "色",
"[表情3]": "发呆",
"[表情4]": "得意",
"[表情5]": "流泪",
"[表情6]": "害羞",
"[表情7]": "闭嘴",
"[表情8]": "睡",
"[表情9]": "大哭",
"[表情10]": "尴尬",
"[表情11]": "发怒",
"[表情12]": "调皮",
"[表情13]": "呲牙",
"[表情14]": "微笑",
"[表情15]": "难过",
"[表情16]": "酷",
"[表情18]": "抓狂",
"[表情19]": "吐",
"[表情20]": "偷笑",
"[表情21]": "可爱",
"[表情22]": "白眼",
"[表情23]": "傲慢",
"[表情24]": "饥饿",
"[表情25]": "困",
"[表情26]": "惊恐",
"[表情27]": "流汗",
"[表情28]": "憨笑",
"[表情29]": "悠闲",
"[表情30]": "奋斗",
"[表情31]": "咒骂",
"[表情32]": "疑问",
"[表情33]": "嘘",
"[表情34]": "晕",
"[表情35]": "折磨",
"[表情36]": "衰",
"[表情37]": "骷髅",
"[表情38]": "敲打",
"[表情39]": "再见",
"[表情41]": "发抖",
"[表情42]": "爱情",
"[表情43]": "跳跳",
"[表情46]": "猪头",
"[表情49]": "拥抱",
"[表情53]": "蛋糕",
"[表情54]": "闪电",
"[表情55]": "炸弹",
"[表情56]": "刀",
"[表情57]": "足球",
"[表情59]": "便便",
"[表情60]": "咖啡",
"[表情61]": "饭",
"[表情63]": "玫瑰",
"[表情64]": "凋谢",
"[表情66]": "爱心",
"[表情67]": "心碎",
"[表情69]": "礼物",
"[表情74]": "太阳",
"[表情75]": "月亮",
"[表情76]": "赞",
"[表情77]": "踩",
"[表情78]": "握手",
"[表情79]": "胜利",
"[表情82]": "飞吻",
"[表情86]": "怄火",
"[表情89]": "西瓜",
"[表情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]": "NO",
"[表情124]": "OK",
"[表情125]": "转圈",
"[表情126]": "磕头",
"[表情127]": "回头",
"[表情128]": "跳绳",
"[表情129]": "挥手",
"[表情130]": "激动",
"[表情131]": "街舞",
"[表情132]": "献吻",
"[表情133]": "左太极",
"[表情134]": "右太极",
"[表情136]": "双喜",
"[表情137]": "嗨皮牛耶",
"[表情138]": "灯笼",
"[表情140]": "K歌",
"[表情144]": "喝彩",
"[表情145]": "祈祷",
"[表情146]": "爆筋",
"[表情147]": "棒棒糖",
"[表情148]": "喝奶",
"[表情151]": "飞机",
"[表情158]": "钞票",
"[表情168]": "药",
"[表情169]": "手枪",
"[表情171]": "茶",
"[表情172]": "眨眼睛",
"[表情173]": "泪奔",
"[表情174]": "无奈",
"[表情175]": "卖萌",
"[表情176]": "小纠结",
"[表情177]": "喷血",
"[表情178]": "斜眼笑",
"[表情179]": "doge",
"[表情180]": "惊喜",
"[表情181]": "骚扰",
"[表情182]": "笑哭",
"[表情183]": "我最美",
"[表情184]": "河蟹",
"[表情185]": "羊驼",
"[表情187]": "幽灵",
"[表情188]": "蛋",
"[表情190]": "菊花",
"[表情192]": "红包",
"[表情193]": "大笑",
"[表情194]": "不开心",
"[表情197]": "冷漠",
"[表情198]": "呃",
"[表情199]": "好棒",
"[表情200]": "拜托",
"[表情201]": "点赞",
"[表情202]": "无聊",
"[表情203]": "托脸",
"[表情204]": "吃",
"[表情205]": "送花",
"[表情206]": "害怕",
"[表情207]": "花痴",
"[表情208]": "小样儿",
"[表情210]": "飙泪",
"[表情211]": "我不看",
"[表情212]": "托腮",
"[表情214]": "啵啵",
"[表情215]": "糊脸",
"[表情216]": "拍头",
"[表情217]": "扯一扯",
"[表情218]": "舔一舔",
"[表情219]": "蹭一蹭",
"[表情220]": "佛系",
"[表情221]": "顶呱呱",
"[表情245]": "加油必胜",
"[表情246]": "加油抱抱",
"[表情247]": "口罩护体",
}
func DecodeFace(encodeFace string) (string, error) {
if v, ok := FaceMap[encodeFace]; ok {
return v, nil
} else {
return "", errors.New("表情未收录")
}
}
func DecodeFaceFromSentences(encode string, format string) string {
r, _ := regexp.Compile(`\[表情[0-9]+?\]`)
return r.ReplaceAllStringFunc(encode, func(s string) string {
tmp, err := DecodeFace(s)
if err != nil {
return fmt.Sprintf(format, "表情未收录")
}
return fmt.Sprintf(format, tmp)
})
}