Skip to content

Commit

Permalink
feat: support get group notice #493 (#1418)
Browse files Browse the repository at this point in the history
* feat: support get group notice #493

* feat: update `go.mod`

* fix
  • Loading branch information
qianjunakasumi committed Mar 18, 2022
1 parent 937538a commit cbcfee9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
11 changes: 11 additions & 0 deletions coolq/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -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=
Expand Down
3 changes: 3 additions & 0 deletions modules/api/api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cbcfee9

Please sign in to comment.