utils

package
v0.0.0-...-400fdf6 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MESSAGE_BLOCK  uint = 0
	MESSAGE_IGNORE uint = 1
)

Variables

View Source
var PluginSet map[string]Plugin

Functions

func FatalError

func FatalError(err error)

func Register

func Register(k string, v Plugin)

Types

type Msg

type Msg struct {
	Text  string
	At    bool
	Image string
}

type Plugin

type Plugin interface {
	Do(ctx *context.Context, guildId, channelId, userId, msg, msgId, username, avatar, srcGuildID string, isBot, isDirectMessage, botIsAdmin, isBotAdmin, isAdmin bool) (retStuct RetStuct)
}

type ReqType

type ReqType int
const (
	GuildBan   ReqType = iota // 频道禁言
	RelieveBan                // 禁言解除
	GuildKick                 // 频道踢人
	GuildMsg                  // 频道消息
	GuildLeave                // 退频道
	DeleteMsg                 // 消息撤回
	Undefined                 // 未定义
)

type RetStuct

type RetStuct struct {
	RetVal         uint
	ReplyMsg       *Msg
	ReqType        ReqType
	Duration       string
	BanId          []string
	RejectAddAgain bool
	Retract        int
}

Jump to

Keyboard shortcuts

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