mirror of
https://github.com/fumiama/NanoBot.git
synced 2026-06-05 18:50:24 +08:00
finish base
This commit is contained in:
31
openapi_user.go
Normal file
31
openapi_user.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package nano
|
||||
|
||||
// User 用户对象
|
||||
//
|
||||
// https://bot.q.qq.com/wiki/develop/api/openapi/user/model.html
|
||||
type User struct {
|
||||
ID string `json:"id"`
|
||||
Username string `json:"username"`
|
||||
Avatar string `json:"avatar"`
|
||||
Bot bool `json:"bot"`
|
||||
UnionOpenid string `json:"union_openid"`
|
||||
UnionUserAccount string `json:"union_user_account"`
|
||||
}
|
||||
|
||||
// GetMe 获取当前用户(机器人)详情
|
||||
//
|
||||
// https://bot.q.qq.com/wiki/develop/api/openapi/user/me.html
|
||||
func (bot *Bot) GetMe() (*User, error) {
|
||||
return bot.getOpenAPIofUser("/users/@me")
|
||||
}
|
||||
|
||||
// GetMyGuilds 获取当前用户(机器人)频道列表,支持分页
|
||||
//
|
||||
// https://bot.q.qq.com/wiki/develop/api/openapi/user/guilds.html
|
||||
func (bot *Bot) GetMyGuilds(before, after string, limit int) (*GuildArray, error) {
|
||||
return bot.getOpenAPIofGuildArray(WriteHTTPQueryIfNotNil("/users/@me/guilds",
|
||||
"before", before,
|
||||
"after", after,
|
||||
"limit", limit,
|
||||
))
|
||||
}
|
||||
Reference in New Issue
Block a user