Documentation ¶
Index ¶
- Constants
- func SendFriendMessageWithBot(b *Bot, group, quote int64, msg ...message.Message) (int64, error)
- func SendGroupMessageWithBot(b *Bot, qq, quote int64, msg ...message.Message) (int64, error)
- type Bot
- func (b *Bot) FetchMessages() error
- func (b *Bot) FriendList() error
- func (b *Bot) GetGroupConfig(target int64) (message.GroupConfig, error)
- func (b *Bot) GetMemberInfo(target, memberID int64) (message.MemberInfo, error)
- func (b *Bot) GroupConfig(target int64, config message.GroupConfig) error
- func (b *Bot) GroupList() error
- func (b *Bot) Kick(target, memberID int64, msg string) error
- func (b *Bot) MemberInfo(target, memberID int64, info message.MemberInfo) error
- func (b *Bot) MemberList(target int64) ([]message.Sender, error)
- func (b *Bot) Mute(target, memberID, time int64) error
- func (b *Bot) MuteAll(target int64) error
- func (b *Bot) Quit(target int64) error
- func (b *Bot) Recall(target int64) error
- func (b *Bot) RespondMemberJoinRequest(eventID, fromID, groupID int64, operate int, message string) error
- func (b *Bot) Run()
- func (b *Bot) SendFriendMessage(qq, quote int64, msg ...message.Message) (int64, error)
- func (b *Bot) SendGroupMessage(group, quote int64, msg ...message.Message) (int64, error)
- func (b *Bot) SendImageMessage(qq, group int64, urls ...string) (imageIds []string, err error)
- func (b *Bot) SendTempMessage(group, qq int64, msg ...message.Message) (int64, error)
- func (b *Bot) SetChannel(time time.Duration, size int)
- func (b *Bot) UnMute(target, memberID int64) error
- func (b *Bot) UnMuteAll(target int64) error
- func (b *Bot) UploadImage(t string, imgFilepath string) (string, error)
- func (b *Bot) UseHandler(handler EventHandler)
- type Client
- type EventHandler
Constants ¶
const ( // OperateAgree 同意入群 OperateAgree = iota // OperateRefuse 拒绝入群 OperateRefuse // OperateIgnore 忽略请求 OperateIgnore // OperateRefuseBan 拒绝入群并添加黑名单,(腾讯)不再接收该用户的入群申请 OperateRefuseBan // OperateIgnoreBan 忽略入群并添加黑名单,(腾讯)不再接收该用户的入群申请 OperateIgnoreBan )
Variables ¶
This section is empty.
Functions ¶
func SendFriendMessageWithBot ¶
SendFriendMessageWithBot 发送好友消息
Types ¶
type Bot ¶
type Bot struct { QQ int64 SessionKey string Client *Client Logger *logrus.Entry Chan chan message.ComplexEvent Friends []message.Friend Groups []message.Group // contains filtered or unexported fields }
Bot 对应一个机器人账号 进行所有对账号相关操作
func (*Bot) GetGroupConfig ¶
func (b *Bot) GetGroupConfig(target int64) (message.GroupConfig, error)
GetGroupConfig 使用此方法获取群设置
func (*Bot) GetMemberInfo ¶
func (b *Bot) GetMemberInfo(target, memberID int64) (message.MemberInfo, error)
GetMemberInfo 使用此方法获取群员资料
func (*Bot) GroupConfig ¶
func (b *Bot) GroupConfig(target int64, config message.GroupConfig) error
GroupConfig 使用此方法修改群设置(需要有相关限权)
func (*Bot) MemberInfo ¶
func (b *Bot) MemberInfo(target, memberID int64, info message.MemberInfo) error
MemberInfo 使用此方法修改群员资料(需要有相关限权)
func (*Bot) MemberList ¶
MemberList 使用此方法获取bot指定群种的成员列表
func (*Bot) RespondMemberJoinRequest ¶
func (b *Bot) RespondMemberJoinRequest(eventID, fromID, groupID int64, operate int, message string) error
RespondMemberJoinRequest 响应用户加群请求 operate 说明 0 同意入群 1 拒绝入群 2 忽略请求 3 拒绝入群并添加黑名单,不再接收该用户的入群申请 4 忽略入群并添加黑名单,不再接收该用户的入群申请
func (*Bot) SendFriendMessage ¶
SendFriendMessage 使用此方法向指定好友发送消息 qq 好友qq quote 引用消息id 0为不引用 msg 消息内容
func (*Bot) SendGroupMessage ¶
SendGroupMessage 使用此方法向指定群发送消息 group 群qq quote 引用消息id 0为不引用 msg 消息内容
func (*Bot) SendImageMessage ¶
SendImageMessage 使用此方法向指定对象(群或好友)发送图片消息 除非需要通过此手段获取imageId,否则不推荐使用该接口 请保证 qq group 不同时有值
func (*Bot) SendTempMessage ¶
SendTempMessage 使用此方法向临时会话对象发送消息 qq 好友qq group 群qq msg 消息内容
func (*Bot) SetChannel ¶
SetChannel Channel相关设置
func (*Bot) UploadImage ¶
UploadImage 使用此方法上传图片文件至服务器并返回ImageId
func (*Bot) UseHandler ¶
func (b *Bot) UseHandler(handler EventHandler)
UseHandler 使用选定的 EventHandler 进行事件响应 未实装
type Client ¶
type Client struct { Name string AuthKey string HTTPClient *gentleman.Client Bots map[int64]*Bot Logger *logrus.Entry }
Client 与Mirai进行沟通
type EventHandler ¶
type EventHandler struct {
// contains filtered or unexported fields
}
EventHandler -