gh

package
v0.4.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetQRCodeURL

func GetQRCodeURL(accessToken string, scene string, expireSeconds ...int) (string, error)

func MakeMessageHandler

func MakeMessageHandler(c echo.Context, msgHandler func(s *server.Server, m *message.MixMessage) *message.Reply) func(*server.Server, *message.MixMessage) *message.Reply

func RegisterEventHandler

func RegisterEventHandler(event EventType, handler Handler)

Types

type ActionInfo

type ActionInfo struct {
	Scene Scene `json:"scene"`
}

type EventType

type EventType string
const (
	EventUserGetCard     EventType = `user_get_card`
	EventUserDelCard     EventType = `user_del_card`
	EventUserConsumeCard EventType = `user_consume_card`
	EventSubscribe       EventType = `subscribe`
	EventUnsubscribe     EventType = `unsubscribe`
	EventScan            EventType = `SCAN`
	EventDefault         EventType = ``
)

type Handler

type Handler func(c echo.Context, s *server.Server, m *message.MixMessage) *message.Reply

type RequestQRCodeCreate

type RequestQRCodeCreate struct {
	ExpireSeconds int        `json:"expire_seconds,omitempty"`
	ActionName    string     `json:"action_name"`
	ActionInfo    ActionInfo `json:"action_info"`
}
{
    "expire_seconds": 604800,
    "action_name": "QR_SCENE",
    "action_info": {
        "scene": {
            "scene_id": 123
        }
    }
}

type ResponseQRCodeCreate

type ResponseQRCodeCreate struct {
	ExpireSeconds int    `json:"expire_seconds"`
	Ticket        string `json:"ticket"`
	URL           string `json:"url"`
}

type Scene

type Scene struct {
	SceneID  int64  `json:"scene_id,omitempty"`  // action_name=QR_SCENE 场景值ID,临时二维码时为32位非0整型,永久二维码时最大值为100000(目前参数只支持1--100000)
	SceneStr string `json:"scene_str,omitempty"` // action_name=QR_STR_SCENE 场景值ID(字符串形式的ID),字符串类型,长度限制为1到64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL