Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ 添加短视频和点赞 #79

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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