Skip to content

Commit

Permalink
update api
Browse files Browse the repository at this point in the history
  • Loading branch information
Redmomn committed Nov 12, 2024
1 parent 78467f6 commit be805fd
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 107 deletions.
6 changes: 3 additions & 3 deletions coolq/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -721,8 +721,8 @@ func (bot *CQBot) CQDelGroupMemo(groupID int64, fid string) global.MSG {
//
// https://git.io/Jtz1V
// @route(set_group_kick)
// @rename(msg->message, block->reject_add_request)
func (bot *CQBot) CQSetGroupKick(groupID int64, userID int64, msg string, block bool) global.MSG {
// @rename(block->reject_add_request)
func (bot *CQBot) CQSetGroupKick(groupID int64, userID int64, block bool) global.MSG {
if g := bot.Client.GetCachedGroupInfo(uint32(groupID)); g != nil {
m := bot.Client.GetCachedMemberInfo(uint32(userID), uint32(groupID))
if m == nil {
Expand Down Expand Up @@ -1098,7 +1098,7 @@ func (bot *CQBot) CQHandleQuickOperation(context, operation gjson.Result) global
bot.CQDeleteMessage(int32(context.Get("message_id").Int()))
}
if !isAnonymous && operation.Get("kick").Bool() {
bot.CQSetGroupKick(context.Get("group_id").Int(), context.Get("user_id").Int(), "", operation.Get("reject_add_request").Bool())
bot.CQSetGroupKick(context.Get("group_id").Int(), context.Get("user_id").Int(), operation.Get("reject_add_request").Bool())
}
if operation.Get("ban").Bool() {
var duration uint32 = 30 * 60
Expand Down
2 changes: 1 addition & 1 deletion coolq/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,9 @@ func (bot *CQBot) groupRecallEvent(c *client.QQClient, e *event2.GroupRecall) {

func (bot *CQBot) groupNotifyEvent(c *client.QQClient, e event2.INotifyEvent) {
group := c.GetCachedGroupInfo(e.From())
switch notify := e.(type) {
// TODO more event
//nolint:gocritic
switch notify := e.(type) {
case *event2.GroupPokeEvent:
sender := c.GetCachedMemberInfo(notify.Sender, e.From())
receiver := c.GetCachedMemberInfo(notify.Receiver, e.From())
Expand Down
140 changes: 79 additions & 61 deletions modules/api/api.go

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

42 changes: 0 additions & 42 deletions pkg/onebot/supported.go

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

0 comments on commit be805fd

Please sign in to comment.