oa := wc.GetOfficialAccount(cfg)
m:=oa.GetMenu()
GetMenu() (resMenu ResMenu, err error)
其中ResMenu
结果为:
//ResMenu 查询菜单的返回数据
type ResMenu struct {
util.CommonError
Menu struct {
Button []Button `json:"button"`
MenuID int64 `json:"menuid"`
} `json:"menu"`
Conditionalmenu []resConditionalMenu `json:"conditionalmenu"`
}
SetMenu(buttons []*Button) error
直接传入json
SetMenuByJSON(jsonInfo string) error
DeleteMenu() error
AddConditional(buttons []*Button, matchRule *MatchRule) error
直接传入json
AddConditionalByJSON(jsonInfo string) error
MenuTryMatch(userID string) (buttons []Button, err error)
DeleteConditional(menuID int64) error
GetCurrentSelfMenuInfo() (resSelfMenuInfo ResSelfMenuInfo, err error)
其中ResSelfMenuInfo
结果为:
type ResSelfMenuInfo struct {
util.CommonError
IsMenuOpen int32 `json:"is_menu_open"`
SelfMenuInfo struct {
Button []SelfMenuButton `json:"button"`
} `json:"selfmenu_info"`
}