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

fix: failed to send to single member #517

Merged
merged 1 commit into from
Aug 16, 2024

Conversation

sunls24
Copy link
Contributor

@sunls24 sunls24 commented Aug 14, 2024

你好,我在使用的过程中发现,当发送消息给单个好友的时候不生效。代码如下:

func PushToAll(content string) error {
	self, err := bot.GetBot().GetCurrentUser()
	if err != nil {
		return err
	}
	friends, err := self.Friends()
	if err != nil {
		return err
	}
	var pin []*openwechat.Friend
	for _, f := range friends {
		if !f.IsPin() {
			continue
		}
		pin = append(pin, f)
	}
	fmt.Println("pin", pin)
	return self.SendTextToFriends(content, time.Second, pin...)
}

pin 中只有一个人的时候就没有反应了。

我查看源码发现应该是这里有问题,请查阅下这个 PR。

@sunls24 sunls24 marked this pull request as draft August 14, 2024 06:53
@sunls24 sunls24 marked this pull request as ready for review August 14, 2024 06:54
@eatmoreapple eatmoreapple merged commit ef8bef5 into eatmoreapple:master Aug 16, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants