bot

package
v2.4.2 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: GPL-3.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Reset       = "\033[0m"
	Red         = "\033[31m"
	Green       = "\033[32m"
	Yellow      = "\033[33m"
	Blue        = "\033[34m"
	Magenta     = "\033[35m"
	Cyan        = "\033[36m"
	White       = "\033[37m"
	BlueBold    = "\033[34;1m"
	MagentaBold = "\033[35;1m"
	RedBold     = "\033[31;1m"
	YellowBold  = "\033[33;1m"
)

Colors

Variables

View Source
var MusicDB *gorm.DB

MusicDB 音乐缓存数据库入口

Functions

func InitLogger added in v2.4.0

func InitLogger(l *logrus.Logger)

func NewLogger added in v2.4.0

func NewLogger(level logger.LogLevel) logger.Interface

func Start

func Start(conf map[string]string) (actionCode int)

Start bot entry

Types

type LogFormatter added in v2.4.0

type LogFormatter struct{}

func (*LogFormatter) Format added in v2.4.0

func (s *LogFormatter) Format(entry *logrus.Entry) ([]byte, error)

type LogInterface added in v2.4.0

type LogInterface interface {
	Info(context.Context, string, ...interface{})
	Warn(context.Context, string, ...interface{})
	Error(context.Context, string, ...interface{})
	Trace(ctx context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), err error)
	LogMode(level logger.LogLevel) logger.Interface
}

type RecognizeResultData added in v2.4.0

type RecognizeResultData struct {
	Data struct {
		Result []struct {
			Song struct {
				Name string `json:"name"`
				Id   int    `json:"id"`
			} `json:"song"`
		} `json:"result"`
	} `json:"data"`
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type SongInfo added in v2.3.0

type SongInfo struct {
	gorm.Model
	MusicID      int
	SongName     string
	SongArtists  string
	SongAlbum    string
	FileExt      string
	MusicSize    int
	PicSize      int
	EmbPicSize   int
	BitRate      int
	Duration     int
	FileID       string
	ThumbFileID  string
	FromUserID   int64
	FromUserName string
	FromChatID   int64
	FromChatName string
}

SongInfo 歌曲信息

Jump to

Keyboard shortcuts

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