Documentation
¶
Index ¶
- Constants
- func MacroAt(qqs []int64) string
- func MacroAtAll() string
- func MacroId() string
- func VoiceMp3ToSilk(mp3Path string) (string, error)
- func VoiceSilkToMp3(base64EncodedSilk string) ([]byte, error)
- type BotManager
- func (b *BotManager) AddEvent(EventName string, f interface{}) error
- func (b *BotManager) Announce(title, text string, pinned, announceType int, groupID int64) error
- func (b *BotManager) Chuo(sendType int, groupID, userId int64) error
- func (b *BotManager) GetFile(fileId string, groupID int64) (FriendFileResult, GroupFileResult, error)
- func (b *BotManager) GetFriendList(startIndex int) (FriendList, error)
- func (b *BotManager) GetGroupList(nextToken string) (GroupList, error)
- func (b *BotManager) GetUserCardInfo(qq int64) (UserCardInfo, error)
- func (b *BotManager) GetUserInfo(qq int64) (UserInfo, error)
- func (b *BotManager) KickGroupMember(groupID, userId int64) error
- func (b *BotManager) OldSendVoice(userID int64, sendToType int, data string) error
- func (b *BotManager) ReCallMsg(GroupID, MsgRandom int64, MsgSeq int) error
- func (b *BotManager) RefreshKey() error
- func (b *BotManager) RegMiddleware(priority int, f func(m map[string]interface{}) map[string]interface{}) error
- func (b *BotManager) Send(sendMsgPack SendMsgPack)
- func (b *BotManager) SetAdmin(flag int, groupID, userId int64) error
- func (b *BotManager) SetForbidden(flag, ShutTime int, groupID, userId int64) error
- func (b *BotManager) SetGroupNewNick(newNick string, groupID, userId int64) error
- func (b *BotManager) SetGroupUniqueTitle(newNick string, groupID, userId int64) error
- func (b *BotManager) SetSendDelayed(Millisecond int)
- func (b *BotManager) Start() error
- func (b *BotManager) Stop()
- func (b *BotManager) Zan(qq int64, num int) int
- type FriendFileResult
- type FriendList
- type FriendMsgPack
- type GroupAdminPack
- type GroupAdminSysNotifyPack
- type GroupExitPack
- type GroupExitSuccessPack
- type GroupFileResult
- type GroupJoinPack
- type GroupList
- type GroupMsgPack
- type GroupRevokePack
- type GroupShutPack
- type GroupSystemNotifyPack
- type MyRecord
- type Result
- type SendMsgPack
- type SendTypeForwordContent
- type SendTypeForwordContentPrivateChat
- type SendTypeJsonContent
- type SendTypeJsonContentPrivateChat
- type SendTypePicMsgByBase64Content
- type SendTypePicMsgByBase64ContentPrivateChat
- type SendTypePicMsgByLocalContent
- type SendTypePicMsgByLocalContentPrivateChat
- type SendTypePicMsgByMd5Content
- type SendTypePicMsgByMd5ContentPrivateChat
- type SendTypePicMsgByUrlContent
- type SendTypePicMsgByUrlContentPrivateChat
- type SendTypeRelayContent
- type SendTypeRelayContentPrivateChat
- type SendTypeTextMsgContent
- type SendTypeTextMsgContentPrivateChat
- type SendTypeVoiceByLocalContent
- type SendTypeVoiceByLocalContentPrivateChat
- type SendTypeVoiceByUrlContent
- type SendTypeVoiceByUrlContentPrivateChat
- type SendTypeXmlContent
- type SendTypeXmlContentPrivateChat
- type UserCardInfo
- type UserInfo
Constants ¶
const ( SendToTypeFriend = 1 SendToTypeGroup = 2 SendToTypePrivateChat = 3 EventNameOnGroupMessage = "OnGroupMsgs" EventNameOnFriendMessage = "OnFriendMsgs" EventNameOnBotEvent = "OnFriendMsgs" EventNameOnGroupJoin = "ON_EVENT_GROUP_JOIN" EventNameOnGroupAdmin = "ON_EVENT_GROUP_ADMIN" EventNameOnGroupExit = "ON_EVENT_GROUP_EXIT" EventNameOnGroupExitSuccess = "ON_EVENT_GROUP_EXIT_SUCC" EventNameOnGroupAdminSysNotify = "ON_EVENT_GROUP_ADMINSYSNOTIFY" EventNameOnGroupRevoke = "ON_EVENT_GROUP_REVOKE" EventNameOnGroupShut = "ON_EVENT_GROUP_SHUT" EventNameOnGroupSystemNotify = "ON_EVENT_GROUP_SYSTEMNOTIFY" EventNameOnConnected = "connection" EventNameOnDisconnected = "disconnection" EventNameOnOther = "other" )
Variables ¶
This section is empty.
Functions ¶
func MacroAtAll ¶
func MacroAtAll() string
func VoiceMp3ToSilk ¶
VoiceMp3ToSilk Mp3转Silk mp3->silk Output: base64 String
func VoiceSilkToMp3 ¶
VoiceSilkToMp3 Silk转Mp3 silk->mp3 Output: []byte 暂未写
Types ¶
type BotManager ¶
type BotManager struct {
QQ int64
SendChan chan SendMsgPack
Running bool
OPQUrl string
// contains filtered or unexported fields
}
func NewBotManager ¶
func NewBotManager(QQ int64, OPQUrl string) BotManager
func (*BotManager) AddEvent ¶
func (b *BotManager) AddEvent(EventName string, f interface{}) error
func (*BotManager) Announce ¶
func (b *BotManager) Announce(title, text string, pinned, announceType int, groupID int64) error
Announce 发公告 Pinned 1为置顶,0为普通公告 announceType 发布类型(10为使用弹窗公告,20为发送给新成员,其他暂未知)
func (*BotManager) Chuo ¶
func (b *BotManager) Chuo(sendType int, groupID, userId int64) error
Chuo 戳戳 sendType 0戳好友 1戳群友 sendType=0 时可以不填此字段 sendType=1 时不能为空
func (*BotManager) GetFile ¶
func (b *BotManager) GetFile(fileId string, groupID int64) (FriendFileResult, GroupFileResult, error)
GetFile 下载文件 groupId 为0 是下载好友分享文件
func (*BotManager) GetFriendList ¶
func (b *BotManager) GetFriendList(startIndex int) (FriendList, error)
GetFriendList 获取好友列表
func (*BotManager) GetGroupList ¶
func (b *BotManager) GetGroupList(nextToken string) (GroupList, error)
GetGroupList 获取好友列表
func (*BotManager) GetUserCardInfo ¶
func (b *BotManager) GetUserCardInfo(qq int64) (UserCardInfo, error)
GetUserCardInfo 获取用户信息
func (*BotManager) GetUserInfo ¶
func (b *BotManager) GetUserInfo(qq int64) (UserInfo, error)
GetUserInfo 获取用户信息
func (*BotManager) KickGroupMember ¶
func (b *BotManager) KickGroupMember(groupID, userId int64) error
KickGroupMember 踢出群成员
func (*BotManager) OldSendVoice ¶
func (b *BotManager) OldSendVoice(userID int64, sendToType int, data string) error
OldSendVoice 发送语音 旧版 将被移出
func (*BotManager) ReCallMsg ¶
func (b *BotManager) ReCallMsg(GroupID, MsgRandom int64, MsgSeq int) error
ReCallMsg 撤回消息
func (*BotManager) RegMiddleware ¶
func (b *BotManager) RegMiddleware(priority int, f func(m map[string]interface{}) map[string]interface{}) error
RegMiddleware 注册 发送函数的中间件 2为最先执行 0为最后执行
func (*BotManager) SetAdmin ¶
func (b *BotManager) SetAdmin(flag int, groupID, userId int64) error
SetAdmin 设置管理员 flag 1为设置管理员 2为取消管理员
func (*BotManager) SetForbidden ¶
func (b *BotManager) SetForbidden(flag, ShutTime int, groupID, userId int64) error
SetForbidden 设置禁言 flag 0为设置全体禁言 1为设置某人禁言 ShutTime 0为取消禁言 >0为禁言分钟数 全体禁言>0为开启禁言
func (*BotManager) SetGroupNewNick ¶
func (b *BotManager) SetGroupNewNick(newNick string, groupID, userId int64) error
SetGroupNewNick 设置群名片
func (*BotManager) SetGroupUniqueTitle ¶
func (b *BotManager) SetGroupUniqueTitle(newNick string, groupID, userId int64) error
SetGroupUniqueTitle 设置群头衔
func (*BotManager) SetSendDelayed ¶
func (b *BotManager) SetSendDelayed(Millisecond int)
SetSendDelayed 设置发送消息的时延 单位毫秒 默认1000
type FriendFileResult ¶
type FriendList ¶
type FriendList struct {
FriendCount int `json:"Friend_count"`
Friendlist []struct {
FriendUin int `json:"FriendUin"`
IsRemark bool `json:"IsRemark"`
NickName string `json:"NickName"`
OnlineStr string `json:"OnlineStr"`
Remark string `json:"Remark"`
Status int `json:"Status"`
} `json:"Friendlist"`
GetfriendCount int `json:"GetfriendCount"`
StartIndex int `json:"StartIndex"`
TotoalFriendCount int `json:"Totoal_friend_count"`
}
FriendList 获取好友列表表单
type FriendMsgPack ¶
type GroupAdminPack ¶
type GroupAdminPack struct {
EventData struct {
Flag int `json:"Flag"`
GroupID int64 `json:"GroupID"`
UserID int64 `json:"UserID"`
} `json:"EventData"`
EventMsg struct {
FromUin int64 `json:"FromUin"`
ToUin int64 `json:"ToUin"`
MsgType string `json:"MsgType"`
MsgSeq int `json:"MsgSeq"`
Content string `json:"Content"`
RedBaginfo interface{} `json:"RedBaginfo"`
} `json:"EventMsg"`
}
type GroupAdminSysNotifyPack ¶
type GroupAdminSysNotifyPack struct {
EventData struct {
Seq int64 `json:"Seq"`
Type int `json:"Type"`
MsgTypeStr string `json:"MsgTypeStr"`
Who int `json:"Who"`
WhoName string `json:"WhoName"`
MsgStatusStr string `json:"MsgStatusStr"`
Content string `json:"Content"`
RefuseContent string `json:"RefuseContent"`
Flag7 int `json:"Flag_7"`
Flag8 int `json:"Flag_8"`
GroupID int64 `json:"GroupId"`
GroupName string `json:"GroupName"`
ActionUin int `json:"ActionUin"`
ActionName string `json:"ActionName"`
ActionGroupCard string `json:"ActionGroupCard"`
Action int `json:"Action"`
} `json:"EventData"`
EventMsg struct {
FromUin int64 `json:"FromUin"`
ToUin int64 `json:"ToUin"`
MsgType string `json:"MsgType"`
MsgSeq int `json:"MsgSeq"`
Content string `json:"Content"`
RedBaginfo interface{} `json:"RedBaginfo"`
} `json:"EventMsg"`
}
type GroupExitPack ¶
type GroupExitPack struct {
EventData struct {
UserID int64 `json:"UserID"`
} `json:"EventData"`
EventMsg struct {
FromUin int64 `json:"FromUin"`
ToUin int64 `json:"ToUin"`
MsgType string `json:"MsgType"`
MsgSeq int `json:"MsgSeq"`
Content string `json:"Content"`
RedBaginfo interface{} `json:"RedBaginfo"`
} `json:"EventMsg"`
}
type GroupExitSuccessPack ¶
type GroupExitSuccessPack struct {
EventData struct {
GroupID int64 `json:"GroupID"`
} `json:"EventData"`
EventMsg struct {
FromUin int64 `json:"FromUin"`
ToUin int64 `json:"ToUin"`
MsgType string `json:"MsgType"`
MsgSeq int `json:"MsgSeq"`
Content string `json:"Content"`
RedBaginfo interface{} `json:"RedBaginfo"`
} `json:"EventMsg"`
}
type GroupFileResult ¶
type GroupJoinPack ¶
type GroupJoinPack struct {
EventData struct {
InviteUin int64 `json:"InviteUin"`
UserID int64 `json:"UserID"`
UserName string `json:"UserName"`
} `json:"EventData"`
EventMsg struct {
FromUin int64 `json:"FromUin"`
ToUin int64 `json:"ToUin"`
MsgType string `json:"MsgType"`
MsgSeq int `json:"MsgSeq"`
Content string `json:"Content"`
RedBaginfo interface{} `json:"RedBaginfo"`
} `json:"EventMsg"`
}
type GroupList ¶
type GroupList struct {
Count int `json:"Count"`
NextToken string `json:"NextToken"`
TroopList []struct {
GroupID int `json:"GroupId"`
GroupMemberCount int `json:"GroupMemberCount"`
GroupName string `json:"GroupName"`
GroupNotice string `json:"GroupNotice"`
GroupOwner int64 `json:"GroupOwner"`
GroupTotalCount int `json:"GroupTotalCount"`
} `json:"TroopList"`
}
GroupList 获取群列表表单
type GroupMsgPack ¶
type GroupMsgPack struct {
Content string `json:"Content"`
FromGroupID int64 `json:"FromGroupId"`
FromGroupName string `json:"FromGroupName"`
FromNickName string `json:"FromNickName"`
FromUserID int64 `json:"FromUserId"`
MsgRandom int64 `json:"MsgRandom"`
MsgSeq int `json:"MsgSeq"`
MsgTime int `json:"MsgTime"`
MsgType string `json:"MsgType"`
RedBaginfo interface{} `json:"RedBaginfo"`
}
type GroupRevokePack ¶
type GroupRevokePack struct {
EventData struct {
AdminUserID int `json:"AdminUserID"`
GroupID int64 `json:"GroupID"`
MsgRandom int64 `json:"MsgRandom"`
MsgSeq int `json:"MsgSeq"`
UserID int64 `json:"UserID"`
} `json:"EventData"`
EventMsg struct {
FromUin int64 `json:"FromUin"`
ToUin int64 `json:"ToUin"`
MsgType string `json:"MsgType"`
MsgSeq int `json:"MsgSeq"`
Content string `json:"Content"`
RedBaginfo interface{} `json:"RedBaginfo"`
} `json:"EventMsg"`
}
type GroupShutPack ¶
type GroupShutPack struct {
EventData struct {
GroupID int64 `json:"GroupID"`
ShutTime int `json:"ShutTime"`
UserID int64 `json:"UserID"`
} `json:"EventData"`
EventMsg struct {
FromUin int64 `json:"FromUin"`
ToUin int64 `json:"ToUin"`
MsgType string `json:"MsgType"`
MsgSeq int `json:"MsgSeq"`
Content string `json:"Content"`
RedBaginfo interface{} `json:"RedBaginfo"`
} `json:"EventMsg"`
}
type GroupSystemNotifyPack ¶
type GroupSystemNotifyPack struct {
EventData struct {
Content string `json:"Content"`
GroupID int64 `json:"GroupID"`
UserID int64 `json:"UserID"`
} `json:"EventData"`
EventMsg struct {
FromUin int64 `json:"FromUin"`
ToUin int64 `json:"ToUin"`
MsgType string `json:"MsgType"`
MsgSeq int `json:"MsgSeq"`
Content string `json:"Content"`
RedBaginfo interface{} `json:"RedBaginfo"`
} `json:"EventMsg"`
}
type SendMsgPack ¶
type SendTypeForwordContent ¶
type SendTypeJsonContent ¶
type SendTypeJsonContent struct {
Content string
}
type SendTypeRelayContent ¶
type SendTypeRelayContent struct {
ReplayInfo interface{}
}
type SendTypeRelayContentPrivateChat ¶
type SendTypeRelayContentPrivateChat struct {
ReplayInfo interface{}
Group int64
}
type SendTypeTextMsgContent ¶
type SendTypeTextMsgContent struct {
Content string
}
type SendTypeVoiceByLocalContent ¶
type SendTypeVoiceByLocalContent struct {
Path string
}
type SendTypeVoiceByUrlContent ¶
type SendTypeVoiceByUrlContent struct {
VoiceUrl string
}
type SendTypeXmlContent ¶
type SendTypeXmlContent struct {
Content string
}
type UserCardInfo ¶
type UserInfo ¶
type UserInfo struct {
Code int `json:"code"`
Data struct {
Astro int `json:"astro"`
AvatarURL string `json:"avatarUrl"`
Bitmap string `json:"bitmap"`
Bluevip int `json:"bluevip"`
Commfrd int `json:"commfrd"`
Friendship int `json:"friendship"`
From string `json:"from"`
Gender int `json:"gender"`
Greenvip int `json:"greenvip"`
IntimacyScore int `json:"intimacyScore"`
IsFriend int `json:"isFriend"`
Logolabel string `json:"logolabel"`
Nickname string `json:"nickname"`
Publicwalfare int `json:"publicwalfare"`
Qqvip int `json:"qqvip"`
Qzone int `json:"qzone"`
Realname string `json:"realname"`
Smartname string `json:"smartname"`
Uin int `json:"uin"`
} `json:"data"`
Default int `json:"default"`
Message string `json:"message"`
Subcode int `json:"subcode"`
}
UserInfo 用户信息表单