Skip to content

Commit

Permalink
✨ 添加短视频和点赞
Browse files Browse the repository at this point in the history
  • Loading branch information
guohuiyuan committed Apr 8, 2024
1 parent 57f71b9 commit 9889ccb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions api.go
Expand Up @@ -132,6 +132,15 @@ func (ctx *Ctx) GetForwardMessage(id string) gjson.Result {
return rsp
}

// SendLike 发送好友赞
// https://github.com/botuniverse/onebot-11/blob/master/api/public.md#send_like-%E5%8F%91%E9%80%81%E5%A5%BD%E5%8F%8B%E8%B5%9E
func (ctx *Ctx) SendLike(userID int64, times int) {
ctx.CallAction("send_like", Params{
"user_id": userID,
"times": times,
})
}

// SetGroupKick 群组踢人
// https://github.com/botuniverse/onebot-11/blob/master/api/public.md#set_group_kick-%E7%BE%A4%E7%BB%84%E8%B8%A2%E4%BA%BA
func (ctx *Ctx) SetGroupKick(groupID, userID int64, rejectAddRequest bool) {
Expand Down
11 changes: 11 additions & 0 deletions message/message.go
Expand Up @@ -217,6 +217,17 @@ func Record(file string) MessageSegment {
}
}

// Video 短视频
// https://github.com/botuniverse/onebot-11/blob/master/message/segment.md#%E7%9F%AD%E8%A7%86%E9%A2%91
func Video(file string) MessageSegment {
return MessageSegment{
Type: "video",
Data: map[string]string{
"file": file,
},
}
}

// At @某人
// https://github.com/botuniverse/onebot-11/tree/master/message/segment.md#%E6%9F%90%E4%BA%BA
func At(qq int64) MessageSegment {
Expand Down

0 comments on commit 9889ccb

Please sign in to comment.