Skip to content

Commit

Permalink
fix: unify message id type
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed May 1, 2024
1 parent fdbe4e1 commit eb574bb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions api.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,19 @@ func (ctx *Ctx) SendPrivateMessage(userID int64, message interface{}) int64 {
// https://github.com/botuniverse/onebot-11/blob/master/api/public.md#delete_msg-%E6%92%A4%E5%9B%9E%E6%B6%88%E6%81%AF
//
//nolint:interfacer
func (ctx *Ctx) DeleteMessage(messageID message.MessageID) {
func (ctx *Ctx) DeleteMessage(messageID interface{}) {
ctx.CallAction("delete_msg", Params{
"message_id": messageID.String(),
"message_id": messageID,
})
}

// GetMessage 获取消息
// https://github.com/botuniverse/onebot-11/blob/master/api/public.md#get_msg-%E8%8E%B7%E5%8F%96%E6%B6%88%E6%81%AF
//
//nolint:interfacer
func (ctx *Ctx) GetMessage(messageID message.MessageID) Message {
func (ctx *Ctx) GetMessage(messageID interface{}) Message {
rsp := ctx.CallAction("get_msg", Params{
"message_id": messageID.String(),
"message_id": messageID,
}).Data
m := Message{
Elements: message.ParseMessage(helper.StringToBytes(rsp.Get("message").Raw)),
Expand Down Expand Up @@ -474,7 +474,7 @@ func (ctx *Ctx) SendPrivateForwardMessage(userID int64, message message.Message)
// ForwardFriendSingleMessage 转发单条消息到好友
//
// https://llonebot.github.io/zh-CN/develop/extends_api
func (ctx *Ctx) ForwardFriendSingleMessage(userID int64, messageID message.MessageID) APIResponse {
func (ctx *Ctx) ForwardFriendSingleMessage(userID int64, messageID interface{}) APIResponse {
return ctx.CallAction("forward_friend_single_msg", Params{
"user_id": userID,
"message_id": messageID,
Expand All @@ -484,7 +484,7 @@ func (ctx *Ctx) ForwardFriendSingleMessage(userID int64, messageID message.Messa
// ForwardGroupSingleMessage 转发单条消息到群
//
// https://llonebot.github.io/zh-CN/develop/extends_api
func (ctx *Ctx) ForwardGroupSingleMessage(groupID int64, messageID message.MessageID) APIResponse {
func (ctx *Ctx) ForwardGroupSingleMessage(groupID int64, messageID interface{}) APIResponse {
return ctx.CallAction("forward_group_single_msg", Params{
"group_id": groupID,
"message_id": messageID,
Expand Down Expand Up @@ -740,7 +740,7 @@ 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 message.MessageID, emojiID string) APIResponse {
func (ctx *Ctx) SetMessageEmojiLike(messageID interface{}, emojiID string) APIResponse {
return ctx.CallAction("set_msg_emoji_like", Params{
"message_id": messageID,
"emoji_id": emojiID,
Expand Down

0 comments on commit eb574bb

Please sign in to comment.