Documentation ¶
Index ¶
- Constants
- Variables
- func CommonLogin() error
- func GenRandomDevice()
- func Init()
- func InitBot(account int64, password string)
- func InitWithDeviceJSONContent(deviceJSONContent []byte)
- func InitWithOption(option InitOption) error
- func Login() error
- func LoginWithOption(option LoginOption) error
- func QrcodeLogin() error
- func RefreshList()
- func RegisterModule(instance Module)
- func SaveToken()
- func StartService()
- func Stop()
- func UseDevice(device []byte) error
- func UseProtocol(p protocol)
- type Bot
- func (bot *Bot) OnDisconnected(f func(qqClient *client.QQClient, event *client.ClientDisconnectedEvent))deprecated
- func (bot *Bot) OnFriendMessageRecalled(f func(qqClient *client.QQClient, event *client.FriendMessageRecalledEvent))deprecated
- func (bot *Bot) OnFriendNotify(f func(qqClient *client.QQClient, event client.INotifyEvent))deprecated
- func (bot *Bot) OnGroupDigest(f func(qqClient *client.QQClient, event *client.GroupDigestEvent))deprecated
- func (bot *Bot) OnGroupInvited(f func(qqClient *client.QQClient, event *client.GroupInvitedRequest))deprecated
- func (bot *Bot) OnGroupJoin(f func(qqClient *client.QQClient, event *client.GroupInfo))deprecated
- func (bot *Bot) OnGroupLeave(f func(qqClient *client.QQClient, event *client.GroupLeaveEvent))deprecated
- func (bot *Bot) OnGroupMemberJoin(f func(qqClient *client.QQClient, event *client.MemberJoinGroupEvent))deprecated
- func (bot *Bot) OnGroupMemberLeave(f func(qqClient *client.QQClient, event *client.MemberLeaveGroupEvent))deprecated
- func (bot *Bot) OnGroupMemberPermissionChanged(f func(qqClient *client.QQClient, event *client.MemberPermissionChangedEvent))deprecated
- func (bot *Bot) OnGroupMessage(f func(qqClient *client.QQClient, event *message.GroupMessage))deprecated
- func (bot *Bot) OnGroupMessageRecalled(f func(qqClient *client.QQClient, event *client.GroupMessageRecalledEvent))deprecated
- func (bot *Bot) OnGroupMuted(f func(qqClient *client.QQClient, event *client.GroupMuteEvent))deprecated
- func (bot *Bot) OnGroupNameUpdated(f func(qqClient *client.QQClient, event *client.GroupNameUpdatedEvent))deprecated
- func (bot *Bot) OnGroupNotify(f func(qqClient *client.QQClient, event client.INotifyEvent))deprecated
- func (bot *Bot) OnMemberCardUpdated(f func(qqClient *client.QQClient, event *client.MemberCardUpdatedEvent))deprecated
- func (bot *Bot) OnMemberSpecialTitleUpdated(...)deprecated
- func (bot *Bot) OnNewFriend(f func(qqClient *client.QQClient, event *client.NewFriendEvent))deprecated
- func (bot *Bot) OnNewFriendRequest(f func(qqClient *client.QQClient, event *client.NewFriendRequest))deprecated
- func (bot *Bot) OnOfflineFile(f func(qqClient *client.QQClient, event *client.OfflineFileEvent))deprecated
- func (bot *Bot) OnOtherClientStatusChanged(f func(qqClient *client.QQClient, event *client.OtherClientStatusChangedEvent))deprecated
- func (bot *Bot) OnPrivateMessage(f func(qqClient *client.QQClient, event *message.PrivateMessage))deprecated
- func (bot *Bot) OnPrivateMessageF(filter func(*message.PrivateMessage) bool, ...)deprecated
- func (bot *Bot) OnSelfGroupMessage(f func(qqClient *client.QQClient, event *message.GroupMessage))deprecated
- func (bot *Bot) OnSelfPrivateMessage(f func(qqClient *client.QQClient, event *message.PrivateMessage))deprecated
- func (bot *Bot) OnTempMessage(f func(qqClient *client.QQClient, event *client.TempMessageEvent))deprecated
- func (bot *Bot) OnUserWantJoinGroup(f func(qqClient *client.QQClient, event *client.UserJoinGroupRequest))deprecated
- type InitOption
- type LoginMethod
- type LoginOption
- type Module
- type ModuleID
- type ModuleInfo
Constants ¶
const ( LoginMethodToken = "token" LoginMethodQRCode = "qrcode" LoginMethodCommon = "common" )
const ( AndroidPhone = protocol(client.AndroidPhone) IPad = protocol(client.IPad) AndroidWatch = protocol(client.AndroidWatch) MacOS = protocol(client.MacOS) )
Variables ¶
var ErrSMSRequestError = errors.New("sms request error")
ErrSMSRequestError SMS请求出错
Functions ¶
func InitWithDeviceJSONContent ¶
func InitWithDeviceJSONContent(deviceJSONContent []byte)
func InitWithOption ¶
func InitWithOption(option InitOption) error
func LoginWithOption ¶
func LoginWithOption(option LoginOption) error
Types ¶
type Bot ¶
Bot 全局 Bot
var Instance *Bot
Instance Bot 实例
func (*Bot) OnDisconnected
deprecated
func (bot *Bot) OnDisconnected(f func(qqClient *client.QQClient, event *client.ClientDisconnectedEvent))
Deprecated: This function is designed to make the framework compatible with the old plug-in, and the newly developed plug-in should no longer use this method
func (*Bot) OnFriendMessageRecalled
deprecated
func (bot *Bot) OnFriendMessageRecalled(f func(qqClient *client.QQClient, event *client.FriendMessageRecalledEvent))
Deprecated: This function is designed to make the framework compatible with the old plug-in, and the newly developed plug-in should no longer use this method
func (*Bot) OnFriendNotify
deprecated
func (bot *Bot) OnFriendNotify(f func(qqClient *client.QQClient, event client.INotifyEvent))
Deprecated: This function is designed to make the framework compatible with the old plug-in, and the newly developed plug-in should no longer use this method
func (*Bot) OnGroupDigest
deprecated
func (bot *Bot) OnGroupDigest(f func(qqClient *client.QQClient, event *client.GroupDigestEvent))
Deprecated: This function is designed to make the framework compatible with the old plug-in, and the newly developed plug-in should no longer use this method
func (*Bot) OnGroupInvited
deprecated
func (bot *Bot) OnGroupInvited(f func(qqClient *client.QQClient, event *client.GroupInvitedRequest))
Deprecated: This function is designed to make the framework compatible with the old plug-in, and the newly developed plug-in should no longer use this method
func (*Bot) OnGroupLeave
deprecated
func (bot *Bot) OnGroupLeave(f func(qqClient *client.QQClient, event *client.GroupLeaveEvent))
Deprecated: This function is designed to make the framework compatible with the old plug-in, and the newly developed plug-in should no longer use this method
func (*Bot) OnGroupMemberJoin
deprecated
func (bot *Bot) OnGroupMemberJoin(f func(qqClient *client.QQClient, event *client.MemberJoinGroupEvent))
Deprecated: This function is designed to make the framework compatible with the old plug-in, and the newly developed plug-in should no longer use this method
func (*Bot) OnGroupMemberLeave
deprecated
func (bot *Bot) OnGroupMemberLeave(f func(qqClient *client.QQClient, event *client.MemberLeaveGroupEvent))
Deprecated: This function is designed to make the framework compatible with the old plug-in, and the newly developed plug-in should no longer use this method
func (*Bot) OnGroupMemberPermissionChanged
deprecated
func (bot *Bot) OnGroupMemberPermissionChanged(f func(qqClient *client.QQClient, event *client.MemberPermissionChangedEvent))
Deprecated: This function is designed to make the framework compatible with the old plug-in, and the newly developed plug-in should no longer use this method
func (*Bot) OnGroupMessage
deprecated
func (bot *Bot) OnGroupMessage(f func(qqClient *client.QQClient, event *message.GroupMessage))
Deprecated: This function is designed to make the framework compatible with the old plug-in, and the newly developed plug-in should no longer use this method
func (*Bot) OnGroupMessageRecalled
deprecated
func (bot *Bot) OnGroupMessageRecalled(f func(qqClient *client.QQClient, event *client.GroupMessageRecalledEvent))
Deprecated: This function is designed to make the framework compatible with the old plug-in, and the newly developed plug-in should no longer use this method
func (*Bot) OnGroupMuted
deprecated
func (bot *Bot) OnGroupMuted(f func(qqClient *client.QQClient, event *client.GroupMuteEvent))
Deprecated: This function is designed to make the framework compatible with the old plug-in, and the newly developed plug-in should no longer use this method
func (*Bot) OnGroupNameUpdated
deprecated
func (bot *Bot) OnGroupNameUpdated(f func(qqClient *client.QQClient, event *client.GroupNameUpdatedEvent))
Deprecated: This function is designed to make the framework compatible with the old plug-in, and the newly developed plug-in should no longer use this method
func (*Bot) OnGroupNotify
deprecated
func (bot *Bot) OnGroupNotify(f func(qqClient *client.QQClient, event client.INotifyEvent))
Deprecated: This function is designed to make the framework compatible with the old plug-in, and the newly developed plug-in should no longer use this method
func (*Bot) OnMemberCardUpdated
deprecated
func (bot *Bot) OnMemberCardUpdated(f func(qqClient *client.QQClient, event *client.MemberCardUpdatedEvent))
Deprecated: This function is designed to make the framework compatible with the old plug-in, and the newly developed plug-in should no longer use this method
func (*Bot) OnMemberSpecialTitleUpdated
deprecated
func (bot *Bot) OnMemberSpecialTitleUpdated(f func(qqClient *client.QQClient, event *client.MemberSpecialTitleUpdatedEvent))
Deprecated: This function is designed to make the framework compatible with the old plug-in, and the newly developed plug-in should no longer use this method
func (*Bot) OnNewFriend
deprecated
func (bot *Bot) OnNewFriend(f func(qqClient *client.QQClient, event *client.NewFriendEvent))
Deprecated: This function is designed to make the framework compatible with the old plug-in, and the newly developed plug-in should no longer use this method
func (*Bot) OnNewFriendRequest
deprecated
func (bot *Bot) OnNewFriendRequest(f func(qqClient *client.QQClient, event *client.NewFriendRequest))
Deprecated: This function is designed to make the framework compatible with the old plug-in, and the newly developed plug-in should no longer use this method
func (*Bot) OnOfflineFile
deprecated
func (bot *Bot) OnOfflineFile(f func(qqClient *client.QQClient, event *client.OfflineFileEvent))
Deprecated: This function is designed to make the framework compatible with the old plug-in, and the newly developed plug-in should no longer use this method
func (*Bot) OnOtherClientStatusChanged
deprecated
func (bot *Bot) OnOtherClientStatusChanged(f func(qqClient *client.QQClient, event *client.OtherClientStatusChangedEvent))
Deprecated: This function is designed to make the framework compatible with the old plug-in, and the newly developed plug-in should no longer use this method
func (*Bot) OnPrivateMessage
deprecated
func (bot *Bot) OnPrivateMessage(f func(qqClient *client.QQClient, event *message.PrivateMessage))
Deprecated: This function is designed to make the framework compatible with the old plug-in, and the newly developed plug-in should no longer use this method
func (*Bot) OnPrivateMessageF
deprecated
func (bot *Bot) OnPrivateMessageF(filter func(*message.PrivateMessage) bool, f func(*client.QQClient, *message.PrivateMessage))
Deprecated: This function is designed to make the framework compatible with the old plug-in, and the newly developed plug-in should no longer use this method
func (*Bot) OnSelfGroupMessage
deprecated
func (bot *Bot) OnSelfGroupMessage(f func(qqClient *client.QQClient, event *message.GroupMessage))
Deprecated: This function is designed to make the framework compatible with the old plug-in, and the newly developed plug-in should no longer use this method
func (*Bot) OnSelfPrivateMessage
deprecated
func (bot *Bot) OnSelfPrivateMessage(f func(qqClient *client.QQClient, event *message.PrivateMessage))
Deprecated: This function is designed to make the framework compatible with the old plug-in, and the newly developed plug-in should no longer use this method
func (*Bot) OnTempMessage
deprecated
func (bot *Bot) OnTempMessage(f func(qqClient *client.QQClient, event *client.TempMessageEvent))
Deprecated: This function is designed to make the framework compatible with the old plug-in, and the newly developed plug-in should no longer use this method
func (*Bot) OnUserWantJoinGroup
deprecated
func (bot *Bot) OnUserWantJoinGroup(f func(qqClient *client.QQClient, event *client.UserJoinGroupRequest))
Deprecated: This function is designed to make the framework compatible with the old plug-in, and the newly developed plug-in should no longer use this method
type InitOption ¶
type LoginMethod ¶
type LoginMethod string
type LoginOption ¶
type LoginOption struct { LoginMethod LoginMethod Token []byte //if not nil, try with most priority UseTokenWhenUnmatchedUin bool }
type Module ¶
type Module interface { MiraiGoModule() ModuleInfo // Init 初始化 // 待所有 Module 初始化完成后 // 进行服务注册 Serve Init() // PostInit 第二次初始化 // 调用该函数时,所有 Module 都已完成第一段初始化过程 // 方便进行跨Module调用 PostInit() // Serve 向Bot注册服务函数 // 结束后调用 Start Serve(bot *Bot) // Start 启用Module // 此处调用为 // “` go // go Start() // “` // 结束后进行登录 Start(bot *Bot) // Stop 应用结束时对所有 Module 进行通知 // 在此进行资源回收 Stop(bot *Bot, wg *sync.WaitGroup) }
Module MiraiGo 中的模块 用于进行模块化设计
type ModuleInfo ¶
ModuleInfo 模块信息
func GetModule ¶
func GetModule(name string) (ModuleInfo, error)
GetModule - 获取一个已注册的 Module 的 ModuleInfo
func (ModuleInfo) String ¶
func (mi ModuleInfo) String() string