push

package
v1.0.47 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2023 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StartStudy = "start_study"

	SCORE = "score"
)

Variables

This section is empty.

Functions

func GetPush

func GetPush(config conf.Config) func(id string, kind string, message string)

func HandleWechat added in v1.0.33

func HandleWechat(rep http.ResponseWriter, req *http.Request)

HandleWechat

@Description:处理wechat的请求接口
* @param rep
* @param req

func InitPushDeer added in v1.0.33

func InitPushDeer() func(id, kind, message string)

func MarkDown

func MarkDown(title, text string, ats ...string) map[string]interface{}

func RegisterHandler added in v1.0.33

func RegisterHandler(key string, action WechatHandler)

func Text

func Text(text string, ats ...string) map[string]interface{}

func TgInit added in v1.0.33

func TgInit()

Types

type Ding

type Ding struct {
	Secret string `json:"Secret"`
	Token  string `json:"token"`
}

func (*Ding) Send

func (d *Ding) Send() func(id string, kind string, message string)

type Event added in v1.0.39

type Event struct {
	Anonymous     anonymous `json:"anonymous"`
	Font          int       `json:"font"`
	GroupId       int64     `json:"group_id"`
	Message       string    `json:"message"`
	MessageType   string    `json:"message_type"`
	PostType      string    `json:"post_type"`
	RawMessage    string    `json:"raw_message"`
	SelfId        int64     `json:"self_id"`
	Sender        Senders   `json:"sender"`
	SubType       string    `json:"sub_type"`
	UserId        int64     `json:"user_id"`
	Time          int       `json:"time"`
	NoticeType    string    `json:"notice_type"`
	RequestType   string    `json:"request_type"`
	Comment       string    `json:"comment"`
	Flag          string    `json:"flag"`
	OperatorID    int       `json:"operator_id"`
	File          Files     `json:"file"`
	Duration      int64     `json:"duration"`
	TargetId      int64     `json:"target_id"` // 运气王id
	HonorType     string    `json:"honor_type"`
	MetaEventType string    `json:"meta_event_type"`
	Status        Status    `json:"status"`
	Interval      int       `json:"interval"`
	CardNew       string    `json:"card_new"` // 新名片
	CardOld       string    `json:"card_old"` // 旧名片
	MessageIds

	GuildID   int64 `json:"guild_id"`
	ChannelID int64 `json:"channel_id"`
	// contains filtered or unexported fields
}

Event

  • 事件 *

func (*Event) Send added in v1.0.39

func (e *Event) Send(message any)

type Files added in v1.0.39

type Files struct {
	Id      string `json:"id"`
	Name    string `json:"name"`
	Size    int64  `json:"size"`
	Busid   int64  `json:"busid"`
	FileUrl string `json:"url"`
}

type Handle added in v1.0.33

type Handle interface {
	// contains filtered or unexported methods
}

type Mather added in v1.0.33

type Mather struct {
	// contains filtered or unexported fields
}

func (Mather) Execute added in v1.0.46

func (m Mather) Execute(bot *Telegram, from int64, args []string)

func (Mather) GetCommand added in v1.0.46

func (m Mather) GetCommand() string

type MessageIds added in v1.0.39

type MessageIds struct {
	MessageID int32 `json:"message_id"`
}

type PushPlus

type PushPlus struct {
	Token string
}

func (*PushPlus) Init

func (p *PushPlus) Init() func(id string, kind, message string)

type QQ added in v1.0.39

type QQ struct {
	// contains filtered or unexported fields
}

func InitQQ added in v1.0.39

func InitQQ() *QQ

func (*QQ) ServeHTTP added in v1.0.39

func (q *QQ) ServeHTTP(writer http.ResponseWriter, request *http.Request)

type Senders added in v1.0.39

type Senders struct {
	Age      int    `json:"age"`
	Area     string `json:"area"`
	Card     string `json:"card"`
	Level    string `json:"level"`
	NickName string `json:"nickname"`
	Role     string `json:"role"`
	Sex      string `json:"sex"`
	Title    string `json:"title"`
	UserId   int    `json:"user_id"`
}

type Status added in v1.0.39

type Status struct {
	AppEnabled     bool        `json:"app_enabled"`
	AppGood        bool        `json:"app_good"`
	AppInitialized bool        `json:"app_initialized"`
	Good           bool        `json:"good"`
	Online         bool        `json:"online"`
	PluginsGood    interface{} `json:"plugins_good"`
	Stat           struct {
		PacketReceived  int `json:"packet_received"`
		PacketSent      int `json:"packet_sent"`
		PacketLost      int `json:"packet_lost"`
		MessageReceived int `json:"message_received"`
		MessageSent     int `json:"message_sent"`
		DisconnectTimes int `json:"disconnect_times"`
		LostTimes       int `json:"lost_times"`
		LastMessageTime int `json:"last_message_time"`
	} `json:"stat"`
}

type Telegram added in v1.0.33

type Telegram struct {
	Token  string
	ChatId int64

	Proxy string
	// contains filtered or unexported fields
}

Telegram @Description:

func (*Telegram) Init added in v1.0.33

func (t *Telegram) Init()

Init *

  • @Description:
  • @receiver t
  • @return func(kind string, message string)

func (*Telegram) SendMsg added in v1.0.33

func (t *Telegram) SendMsg(id int64, message string) int

func (*Telegram) SendPhoto added in v1.0.33

func (t *Telegram) SendPhoto(id int64, image []byte)

type TypeSecret

type TypeSecret struct {
	Webhook string
	Secret  string
}

func (*TypeSecret) SendMessage

func (t *TypeSecret) SendMessage(data map[string]interface{}) error

SendMessage Function to send message

type WechatHandler added in v1.0.33

type WechatHandler func(id string, msg string)

Jump to

Keyboard shortcuts

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