Documentation
¶
Index ¶
- Constants
- Variables
- type Bot
- func (b *Bot) AddReply(replies []*Reply) (err error)
- func (b *Bot) AddTimerReply(timerReplies []*TimerReply) (err error)
- func (b *Bot) Chat(wb WsBody)
- func (b *Bot) CleanMessages()
- func (b *Bot) FindFriend(friendId string) (friend *openwechat.Friend, err error)
- func (b *Bot) FindGroup(groupId string) (group *openwechat.Group, err error)
- func (b *Bot) Friends() (friends openwechat.Friends, err error)
- func (b *Bot) Groups() (groups openwechat.Groups, err error)
- func (b *Bot) LoginCallBack(body openwechat.CheckLoginResponse)
- func (b *Bot) ReceiveMessage(message []byte) (err error)
- func (b *Bot) ScanCallBack(body openwechat.CheckLoginResponse)
- func (b *Bot) SendMessage(wb WsBody)
- type ChatMsg
- type FriendsGroups
- type Reply
- type TimerReply
- type UserInfo
- type Wechat
- func (w *Wechat) Bot(uid int64) (weBot *Bot)
- func (w *Wechat) Friends(uid int64) (friends openwechat.Friends, err error)
- func (w *Wechat) GetCurrentUser(uid int64) (self *openwechat.Self, err error)
- func (w *Wechat) Groups(uid int64) (groups openwechat.Groups, err error)
- func (w *Wechat) Qrcode(uid int64, replies []*Reply, timerRelies []*TimerReply) (code string, err error)
- type WsBody
Constants ¶
View Source
const (
AvatarType messageType = "avatar"
)
Variables ¶
View Source
var ( DefaultTemplateReply = map[string]template{ "now": { Description: fmt.Sprintf("系统时间,例如:%v", common.TimeFullFormat), // contains filtered or unexported fields }, "week": { Description: fmt.Sprintf("星期几,例如:%v", time.Now().Weekday().String()), // contains filtered or unexported fields }, "woami": { Description: "微信昵称", // contains filtered or unexported fields }, } )
回复模板
Functions ¶
This section is empty.
Types ¶
type Bot ¶
type Bot struct { *openwechat.Bot Self *openwechat.Self Messages chan []byte // contains filtered or unexported fields }
func (*Bot) AddTimerReply ¶
func (b *Bot) AddTimerReply(timerReplies []*TimerReply) (err error)
AddTimerReply 添加定时发送消息
func (*Bot) CleanMessages ¶
func (b *Bot) CleanMessages()
func (*Bot) FindFriend ¶
func (b *Bot) FindFriend(friendId string) (friend *openwechat.Friend, err error)
func (*Bot) FindGroup ¶
func (b *Bot) FindGroup(groupId string) (group *openwechat.Group, err error)
func (*Bot) LoginCallBack ¶
func (b *Bot) LoginCallBack(body openwechat.CheckLoginResponse)
func (*Bot) ReceiveMessage ¶
func (*Bot) ScanCallBack ¶
func (b *Bot) ScanCallBack(body openwechat.CheckLoginResponse)
func (*Bot) SendMessage ¶
type FriendsGroups ¶
type Reply ¶
type Reply struct { FriendsGroups Rules map[string]string // 适配正则 }
type TimerReply ¶
type TimerReply struct { FriendsGroups Msg string Spec string Times int EntryId int }
type UserInfo ¶
type UserInfo struct { HideInputBarFlag int `json:"hide_input_bar_flag"` StarFriend int `json:"star_friend"` Sex int `json:"sex"` AppAccountFlag int `json:"app_account_flag"` VerifyFlag int `json:"verify_flag"` ContactFlag int `json:"contact_flag"` WebWxPluginSwitch int `json:"web_wx_plugin_switch"` HeadImgFlag int `json:"head_img_flag"` SnsFlag int `json:"sns_flag"` IsOwner int `json:"is_owner"` MemberCount int `json:"member_count"` ChatRoomId int `json:"chat_room_id"` UniFriend int `json:"uni_friend"` OwnerUin int `json:"owner_uin"` Statues int `json:"statues"` AttrStatus int64 `json:"attr_status"` Uin string `json:"uin"` Province string `json:"province"` City string `json:"city"` Alias string `json:"alias"` DisplayName string `json:"display_name"` KeyWord string `json:"key_word"` EncryChatRoomId string `json:"encry_chat_room_id"` UserName string `json:"user_name"` NickName string `json:"nick_name"` HeadImgUrl string `json:"head_img_url"` RemarkName string `json:"remark_name"` PYInitial string `json:"py_initial"` PYQuanPin string `json:"py_quan_pin"` RemarkPYInitial string `json:"remark_py_initial"` RemarkPYQuanPin string `json:"remark_py_quan_pin"` Signature string `json:"signature"` HeadImgBase64 string `json:"head_img_base64"` }
Click to show internal directories.
Click to hide internal directories.