Documentation
¶
Index ¶
- func CallerPackageName(skipPkgName string) string
- func DeleteStringInSlice(slice []string, str ...string) []string
- func DirExists(path string) bool
- func FileExists(path string) bool
- func FormSetByStrings(slices ...[]string) map[string]struct{}
- func GetArgs(ctx *zero.Ctx) string
- func GetBotConfig() zero.Config
- func GetBotCtx() *zero.Ctx
- func GetBotNickname() string
- func GetCommand(ctx *zero.Ctx) string
- func GetImageFileMsg(file string) (message.MessageSegment, error)
- func GetImageURL(msg message.MessageSegment) string
- func GetImageURLs(e *zero.Event) (urls []string)
- func GetNeedStatistic(ctx *zero.Ctx) bool
- func GetPkgNameByFunc(fn interface{}) string
- func GetQQAvatar(qq int64, size int) (io.ReadCloser, error)
- func GetQQGroupAvatar(id int64, size int) (io.ReadCloser, error)
- func GetRegexpMatched(ctx *zero.Ctx) []string
- func GoAndWait(handlers ...func() error) (err error)
- func IsGroupAnonymous(ctx *zero.Ctx) bool
- func IsLetter(s string) bool
- func IsMessage(ctx *zero.Ctx) bool
- func IsMessageGroup(ctx *zero.Ctx) bool
- func IsMessageGuild(ctx *zero.Ctx) bool
- func IsMessagePrimary(ctx *zero.Ctx) bool
- func IsNumber(s string) bool
- func IsOneBotLocal() (res bool)
- func IsSameFunc(fnL, fnR interface{}) bool
- func IsSuperUser(userID int64) bool
- func JsonString(v interface{}) string
- func MakeDir(path string) (string, error)
- func MakeDirWithMode(path string, perm os.FileMode) (string, error)
- func MergeStringSlices(slices ...[]string) (res []string)
- func NewGormLogger() *loggerGorm
- func PathExists(path string) bool
- func PathJoin(paths ...string) string
- func PathSize(path string) uint64
- func RemovePath(path string) error
- func SendToSuper(message ...message.MessageSegment)
- func SetNotStatistic(ctx *zero.Ctx)
- func SplitOnSpace(x string) []string
- func StringRealLength(s string) int
- func StringSliceContain(slices []string, substr string) bool
- func WaitNextMessage(ctx *zero.Ctx) *zero.Event
- type LoggerCron
- type SimpleFormatter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallerPackageName ¶
func DeleteStringInSlice ¶ added in v0.1.0
DeleteStringInSlice 删除字符串切片中的str元素,并去重
func FormSetByStrings ¶
FormSetByStrings 将字符串切片形成Set
func GetImageFileMsg ¶ added in v0.1.0
func GetImageFileMsg(file string) (message.MessageSegment, error)
GetImageFileMsg 将本地图片文件自动转换为CQ码消息
func GetImageURL ¶ added in v0.1.0
func GetImageURL(msg message.MessageSegment) string
GetImageURL 通过消息获取其中的图片URL
func GetImageURLs ¶ added in v0.1.0
GetImageURLs 获取消息全部图片URL
func GetNeedStatistic ¶ added in v0.1.2
GetNeedStatistic 获取此次调用是否需要统计
func GetPkgNameByFunc ¶
func GetPkgNameByFunc(fn interface{}) string
func GetQQGroupAvatar ¶
func GetQQGroupAvatar(id int64, size int) (io.ReadCloser, error)
GetQQGroupAvatar 快捷获取QQ群头像
func GetRegexpMatched ¶ added in v0.1.0
GetRegexpMatched 获取正则匹配字符串切片
func IsGroupAnonymous ¶ added in v0.1.0
IsGroupAnonymous 判断是否为群匿名消息
func IsMessageGroup ¶ added in v0.1.0
IsMessageGroup 是否为群聊消息
func IsMessageGuild ¶ added in v0.1.0
IsMessageGuild 是否为频道消息
func IsOneBotLocal ¶ added in v0.1.0
func IsOneBotLocal() (res bool)
IsOneBotLocal 判断OneBot(消息收发端)是否在本地
func IsSameFunc ¶
func IsSameFunc(fnL, fnR interface{}) bool
func MakeDirWithMode ¶
MakeDirWithMode 依据文件夹权限创建文件夹并返回文件夹绝对路径
func MergeStringSlices ¶
MergeStringSlices 合并多个字符串切片并去重、去除空字符串
func NewGormLogger ¶
func NewGormLogger() *loggerGorm
func SendToSuper ¶
func SendToSuper(message ...message.MessageSegment)
SendToSuper 将消息发送给所有后端的所有超级用户
func SetNotStatistic ¶ added in v0.1.2
SetNotStatistic 设置此次调用不统计
func SplitOnSpace ¶ added in v0.1.3
SplitOnSpace 按文字、空格、文字...分隔字符串
func StringRealLength ¶ added in v0.1.0
StringRealLength 计算字符串的真实长度
func StringSliceContain ¶ added in v0.1.0
StringSliceContain 字符串切片中是否含有指定字符串
Types ¶
type LoggerCron ¶
type LoggerCron struct{}
func NewCronLogger ¶
func NewCronLogger() *LoggerCron
func (*LoggerCron) Error ¶
func (l *LoggerCron) Error(err error, msg string, keysAndValues ...interface{})
func (*LoggerCron) Info ¶
func (l *LoggerCron) Info(msg string, keysAndValues ...interface{})
type SimpleFormatter ¶ added in v0.1.0
type SimpleFormatter struct{}
Click to show internal directories.
Click to hide internal directories.