fix: receiver里fileHelper为空的情况 (#186)
Co-authored-by: tgNotHouse <gqwj007@gmail.com>
This commit is contained in:
parent
9b5590f708
commit
88b6a34307
@ -148,3 +148,6 @@ var videoType = "mp4"
|
|||||||
// ZombieText 检测僵尸好友字符串
|
// ZombieText 检测僵尸好友字符串
|
||||||
// 发送该字符给好友,能正常发送不报错的为正常好友,否则为僵尸好友
|
// 发送该字符给好友,能正常发送不报错的为正常好友,否则为僵尸好友
|
||||||
const ZombieText = "وُحfخe ̷̴̐nخg ̷̴̐cخh ̷̴̐aخo امارتيخ ̷̴̐خ\n"
|
const ZombieText = "وُحfخe ̷̴̐nخg ̷̴̐cخh ̷̴̐aخo امارتيخ ̷̴̐خ\n"
|
||||||
|
|
||||||
|
// FileHelper 文件传输助手
|
||||||
|
const FileHelper = "filehelper"
|
||||||
|
@ -114,9 +114,10 @@ func (m *Message) Receiver() (*User, error) {
|
|||||||
return m.bot.self.User, nil
|
return m.bot.self.User, nil
|
||||||
}
|
}
|
||||||
// https://github.com/eatmoreapple/openwechat/issues/113
|
// https://github.com/eatmoreapple/openwechat/issues/113
|
||||||
if m.ToUserName == m.bot.self.fileHelper.UserName {
|
if m.ToUserName == FileHelper {
|
||||||
return m.bot.self.fileHelper.User, nil
|
return m.bot.self.FileHelper().User, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if m.IsSendByGroup() {
|
if m.IsSendByGroup() {
|
||||||
groups, err := m.bot.self.Groups()
|
groups, err := m.bot.self.Groups()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
2
user.go
2
user.go
@ -789,7 +789,7 @@ func newFriend(username string, self *Self) *Friend {
|
|||||||
// NewFriendHelper 创建一个文件传输助手
|
// NewFriendHelper 创建一个文件传输助手
|
||||||
// 文件传输助手的微信身份标识符永远是filehelper
|
// 文件传输助手的微信身份标识符永远是filehelper
|
||||||
func NewFriendHelper(self *Self) *Friend {
|
func NewFriendHelper(self *Self) *Friend {
|
||||||
return newFriend("filehelper", self)
|
return newFriend(FileHelper, self)
|
||||||
}
|
}
|
||||||
|
|
||||||
// SendTextToMp 发送文本消息给公众号
|
// SendTextToMp 发送文本消息给公众号
|
||||||
|
Loading…
x
Reference in New Issue
Block a user