core

package
v0.0.0-...-6781889 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckInvitation

func CheckInvitation(hcontext *HanldeContext, score *score.MemberScore) (bool, error)

检查邀请人数是否增加,赋予对应积分

func CheckOnceDay

func CheckOnceDay(hcontext *HanldeContext, score *score.MemberScore) (time.Time, bool)

func CheckOnceDayWithKey

func CheckOnceDayWithKey(hcontext *HanldeContext, score *score.MemberScore, key string) (time.Time, bool)

func GetFileMessageFromCache

func GetFileMessageFromCache(id string) *model.FileMessage

func NewDodoClient

func NewDodoClient(options *DodoOptions) (client.Client, error)

func ParseFileMessage

func ParseFileMessage(context *HanldeContext, message *websocket.ChannelMessageEventBody) *model.FileMessage

func ParseTextMessage

func ParseTextMessage(context *HanldeContext, message *websocket.ChannelMessageEventBody) string

func ServerAndFileMessageEquals

func ServerAndFileMessageEquals(context *HanldeContext, message *websocket.ChannelMessageEventBody, groupId string) bool

func ServerAndTxtMessageEquals

func ServerAndTxtMessageEquals(context *HanldeContext, message *websocket.ChannelMessageEventBody, groupId string, str string) bool

func SetFileMessageCache

func SetFileMessageCache(id string, v *model.FileMessage)

func TxtMessageEquals

func TxtMessageEquals(context *HanldeContext, message *websocket.ChannelMessageEventBody, str string) bool

func TxtMessageEqualsFunc

func TxtMessageEqualsFunc(context *HanldeContext, message *websocket.ChannelMessageEventBody, predicate func(str string) bool) bool

Types

type ChannelMessageFunc

type ChannelMessageFunc = func(context *HanldeContext, message *websocket.ChannelMessageEventBody) error

type ChannelMessageHandler

type ChannelMessageHandler interface {
	Handle(context *HanldeContext, message *websocket.ChannelMessageEventBody) error
}

type ChannelMessageHandlerFunc

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

func (ChannelMessageHandlerFunc) Handle

type DodoOptions

type DodoOptions struct {
	ClientId string
	Token    string
	// 重试间隔秒数
	Timeout int64
}

type DodoRobot

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

func NewDodoRobot

func NewDodoRobot(options *DodoOptions, client client.Client) (DodoRobot, error)

func (*DodoRobot) Run

func (robot *DodoRobot) Run() error

func (*DodoRobot) Stop

func (bot *DodoRobot) Stop() error

type HanldeContext

type HanldeContext struct {
	Client client.Client
	Time   time.Time
	Items  map[string]interface{}
}

func NewHandleContext

func NewHandleContext(client client.Client) HanldeContext

type OptionHandlerBuilder

type OptionHandlerBuilder struct {
}

func NewMessageHandlersBuilder

func NewMessageHandlersBuilder() *OptionHandlerBuilder

func (*OptionHandlerBuilder) Build

func (builder *OptionHandlerBuilder) Build(client client.Client) websocket.OptionHandler

Jump to

Keyboard shortcuts

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