Skip to content

Commit

Permalink
fix: group not found report (#2312) (#2337)
Browse files Browse the repository at this point in the history
解决以下问题:
当群组踢人时,该人不在群内,返回“群聊不存在”的BUG

#1774 (comment)

Co-authored-by: PSoul <[email protected]>
  • Loading branch information
fumiama and PSoul committed Aug 1, 2023
1 parent aa3a5d2 commit a3ad233
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion coolq/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,9 @@ func (bot *CQBot) CQDelGroupMemo(groupID int64, fid string) global.MSG {
// @rename(msg->message, block->reject_add_request)
func (bot *CQBot) CQSetGroupKick(groupID int64, userID int64, msg string, block bool) global.MSG {
if g := bot.Client.FindGroup(groupID); g != nil {
if m := g.FindMember(userID); m != nil {
if m := g.FindMember(userID); m == nil {
return Failed(100, "MEMBER_IS_NOT_IN_GROUP", "人员不存在")
} else {

Check warning on line 1154 in coolq/api.go

View workflow job for this annotation

GitHub Actions / lint

indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (revive)
err := m.Kick(msg, block)
if err != nil {
return Failed(100, "NOT_MANAGEABLE", "机器人权限不足")
Expand Down

0 comments on commit a3ad233

Please sign in to comment.