Skip to content

Commit

Permalink
fix: api.SetMessageEmojiLike
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed May 4, 2024
1 parent eb574bb commit 0d0388f
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 3 deletions.
11 changes: 8 additions & 3 deletions api.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"encoding/base64"
"encoding/hex"
"encoding/json"
"errors"
"fmt"
"regexp"
"strconv"
Expand Down Expand Up @@ -740,9 +741,13 @@ func (ctx *Ctx) GetFile(fileID string) gjson.Result {
// https://llonebot.github.io/zh-CN/develop/extends_api
//
// emoji_id 参考 https://bot.q.qq.com/wiki/develop/api-v2/openapi/emoji/model.html#EmojiType
func (ctx *Ctx) SetMessageEmojiLike(messageID interface{}, emojiID string) APIResponse {
return ctx.CallAction("set_msg_emoji_like", Params{
func (ctx *Ctx) SetMessageEmojiLike(messageID interface{}, emojiID rune) error {
ret := ctx.CallAction("set_msg_emoji_like", Params{
"message_id": messageID,
"emoji_id": emojiID,
})
}).Data.Get("errMsg").Str
if ret != "" {
return errors.New(ret)
}
return nil
}
88 changes: 88 additions & 0 deletions message/face.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
package message

var Emoji = map[int]rune{
0: 128558, // 😮 face exhaling
1: 128556, // 😬 grimacing face
2: 128525, // 😍 smiling face with heart-eyes
4: 128526, // 😎 smiling face with sunglasses
5: 128557, // 😭 loudly crying face
6: 129402, // 🥺 pleading face
7: 129296, // 🤐 zipper-mouth face
8: 128554, // 😪 sleepy face
9: 128557, // 😭 loudly crying face
10: 128517, // 😅 grinning face with sweat
11: 128545, // 😡 pouting face
12: 128539, // 😛 face with tongue
13: 128513, // 😁 beaming face with smiling eyes
14: 128578, // 🙂 slightly smiling face
15: 128577, // 🙁 slightly frowning face
16: 128526, // 😎 smiling face with sunglasses
19: 129326, // 🤮 face vomiting throw
20: 129325, // 🤭 face with hand over mouth embarrassed
21: 128522, // 😊 smiling face with smiling eyes
23: 128533, // 😕 confused face
24: 128523, // 😋 face savoring food
25: 129393, // 🥱 yawning face
26: 128561, // 😱 face screaming in fear
27: 128531, // 😓 downcast face with sweat
28: 128516, // 😄 grinning face with smiling eyes
29: 128524, // 😌 relieved face
30: 128170, // 💪 flexed biceps
31: 129324, // 🤬 face with symbols on mouth
32: 129300, // 🤔 thinking face question hmmm
33: 129323, // 🤫 shushing face quiet whisper
34: 128565, // 😵 face with crossed-out eyes
35: 128547, // 😣 persevering face
37: 128128, // 💀 skull
38: 128296, // 🔨 hammer
39: 128075, // 👋 waving hand
41: 129398, // 🥶 freezing
42: 128147, // 💓 beating heart
46: 128055, // 🐷 pig face
49: 129303, // 🤗 hugging face
53: 127874, // 🎂 birthday cake
59: 128169, // 💩 pile of poo
60: 9749, // ☕ hot beverage coffee cup tea
63: 127801, // 🌹 rose flower
66: 10084, // ❤ mending heart
67: 128148, // 💔 broken heart
69: 127873, // 🎁 wrapped-gift
74: 127774, // 🌞 sun with face
75: 127772, // 🌜 last quarter moon face
76: 128077, // 👍 thumb up
78: 129309, // 🤝 hand shake
79: 9996, // ✌️ victory
85: 128536, // 😘 face throwing a kiss
89: 127817, // 🍉 watermelon
96: 128517, // 😅 grinning face with sweat
99: 128079, // 👏 clapping hands
104: 129393, // 🥱 yawning face
106: 129401, // 🥹 holding back tears
109: 128535, // 😗 kissing face
110: 128562, // 😲 astonished face
111: 129402, // 🥺 pleading face
116: 128536, // 😘 face throwing a kiss
120: 128074, // 👊 fisted hand
122: 128536, // 😘 face throwing a kiss
123: 10060, // ❌ no
124: 128076, // 👌 ok hand
129: 128587, // 🙋 raising one hand
144: 128079, // 👏 clapping hands
147: 127853, // 🍭 lollipop
171: 127861, // 🍵 tea
172: 128539, // 😛 face with tongue
173: 128557, // 😭 loudly crying face
174: 128558, // 😮‍💨 sigh
175: 128539, // 😛 moe uri
182: 128514, // 😂 face with tears of joy
187: 128123, // 👻 ghost
201: 128077, // 👍 thumb up
214: 128536, // 😘 face throwing a kiss
222: 129303, // 🤗 hugging face
227: 128079, // 👏 clapping hands
247: 128567, // 😷 face with medical mask
264: 129318, // 🤦 dace palm
272: 128579, // 🙃 upside-down face
320: 129395, // 🥳 partying face
325: 128561, // 😱 face screaming in fear
}

0 comments on commit 0d0388f

Please sign in to comment.