1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-04 19:17:37 +08:00

feat: support get group notice #493 (#1418)

* feat: support get group notice #493

* feat: update `go.mod`

* fix
This commit is contained in:
千橘 雫霞 2022-03-18 21:15:53 +08:00 committed by GitHub
parent 937538a7cb
commit cbcfee9f69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 3 deletions

View File

@ -995,6 +995,17 @@ func (bot *CQBot) CQSetGroupName(groupID int64, name string) global.MSG {
return Failed(100, "GROUP_NOT_FOUND", "群聊不存在")
}
// CQGetGroupMemo 扩展API-获取群公告
// @route(_get_group_notice)
func (bot *CQBot) CQGetGroupMemo(groupID int64) global.MSG {
r, err := bot.Client.GetGroupNotice(groupID)
if err != nil {
return Failed(100, "获取群公告失败", err.Error())
}
return OK(r)
}
// CQSetGroupMemo 扩展API-发送群公告
//
// https://docs.go-cqhttp.org/api/#%E5%8F%91%E9%80%81%E7%BE%A4%E5%85%AC%E5%91%8A

2
go.mod
View File

@ -4,7 +4,7 @@ go 1.18
require (
github.com/Microsoft/go-winio v0.5.1
github.com/Mrs4s/MiraiGo v0.0.0-20220318113435-f5950d72fa77
github.com/Mrs4s/MiraiGo v0.0.0-20220318123613-8fa49fedb994
github.com/RomiChan/websocket v1.4.3-0.20220123145318-307a86b127bc
github.com/fumiama/go-hide-param v0.1.4
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible

4
go.sum
View File

@ -1,7 +1,7 @@
github.com/Microsoft/go-winio v0.5.1 h1:aPJp2QD7OOrhO5tQXqQoGSJc+DjDtWTGLOmNyAm6FgY=
github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84=
github.com/Mrs4s/MiraiGo v0.0.0-20220318113435-f5950d72fa77 h1:SmyVuRtew04EETyL24+IxzQ+Tr8YhhPpAFmgx20V2nI=
github.com/Mrs4s/MiraiGo v0.0.0-20220318113435-f5950d72fa77/go.mod h1:kkUjOuOj2FMfqEEtnan/mxxKBZopYRBVIR4gSAdt7Hs=
github.com/Mrs4s/MiraiGo v0.0.0-20220318123613-8fa49fedb994 h1:wqsMt+ob6KMNEl0EWzn9nPoCEQx886UlFRPU9YdRpBQ=
github.com/Mrs4s/MiraiGo v0.0.0-20220318123613-8fa49fedb994/go.mod h1:kkUjOuOj2FMfqEEtnan/mxxKBZopYRBVIR4gSAdt7Hs=
github.com/RomiChan/protobuf v0.0.0-20220318113238-d8a99598f896 h1:UFAqSbH6VqW5mEzQV2HVB7+p3k9JfTbidWJ/9F15yz0=
github.com/RomiChan/protobuf v0.0.0-20220318113238-d8a99598f896/go.mod h1:CKKOWC7mBxd36zxsCB1V8DTrwlTNRQvkSVbYqyUiGEE=
github.com/RomiChan/websocket v1.4.3-0.20220123145318-307a86b127bc h1:AAx50/fb/xS4lvsdQg+bFbGvqSDhyV1MF+p2PLCamZ0=

View File

@ -21,6 +21,9 @@ func (c *Caller) call(action string, p Getter) global.MSG {
case ".ocr_image", "ocr_image":
p0 := p.Get("image").String()
return c.bot.CQOcrImage(p0)
case "_get_group_notice":
p0 := p.Get("group_id").Int()
return c.bot.CQGetGroupMemo(p0)
case "_get_model_show":
p0 := p.Get("model").String()
return c.bot.CQGetModelShow(p0)