1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-05 03:23:49 +08:00

feat: qidian_get_account_info.

This commit is contained in:
Mrs4s 2021-05-03 15:45:34 +08:00
parent dfcd9a523c
commit 605d8bb07d
No known key found for this signature in database
GPG Key ID: 3186E98FA19CE3A7
2 changed files with 17 additions and 0 deletions

View File

@ -46,6 +46,18 @@ func (bot *CQBot) CQGetLoginInfo() MSG {
return OK(MSG{"user_id": bot.Client.Uin, "nickname": bot.Client.Nickname})
}
// CQGetQiDianAccountInfo 获取企点账号信息
func (bot *CQBot) CQGetQiDianAccountInfo() MSG {
if bot.Client.QiDian == nil {
return Failed(100, "QIDIAN_PROTOCOL_REQUEST", "请使用企点协议")
}
return OK(MSG{
"master_id": bot.Client.QiDian.MasterUin,
"ext_name": bot.Client.QiDian.ExtName,
"create_time": bot.Client.QiDian.CreateTime,
})
}
// CQGetFriendList 获取好友列表
//
// https://git.io/Jtz1L

View File

@ -24,6 +24,10 @@ func getLoginInfo(bot *coolq.CQBot, _ resultGetter) coolq.MSG {
return bot.CQGetLoginInfo()
}
func getQiDianAccountInfo(bot *coolq.CQBot, _ resultGetter) coolq.MSG {
return bot.CQGetQiDianAccountInfo()
}
func getFriendList(bot *coolq.CQBot, _ resultGetter) coolq.MSG {
return bot.CQGetFriendList()
}
@ -393,6 +397,7 @@ var API = map[string]func(*coolq.CQBot, resultGetter) coolq.MSG{
"check_url_safely": checkURLSafely,
"set_group_anonymous_ban": setGroupAnonymousBan,
".handle_quick_operation": handleQuickOperation,
"qidian_get_account_info": getQiDianAccountInfo,
}
func (api *apiCaller) callAPI(action string, p resultGetter) coolq.MSG {