Documentation
¶
Overview ¶
Package utils ARK Message model, Now work yet.
Package utils For MAIMAI | CHUN SQL DATABASE, SAVED AS USERNAME => USER UINT ID.
Package utils Transform => Make Image To Local Proxy Server, send Link.
Index ¶
- func Average(numbers []int) float64
- func BindUserGenaralInfo(userid uint64, username string) error
- func BreakWords(getSongName string, breakerCount float64) string
- func DownloadImage(url string) (image.Image, error)
- func DrawBorderSimple(page *gg.Context, s string, x float64, y float64, inlineRGB color.Color, ...)
- func DrawBorderString(page *gg.Context, s string, size int, x float64, y float64, ax float64, ...)
- func GetAverageColorAndMakeAdjust(image image.Image) (int, int, int)
- func GetBotSelfImage(ctx *nano.Ctx) image.Image
- func GetUserAvatar(ctx *nano.Ctx) image.Image
- func GetUserInfoName(ctx *nano.Ctx) string
- func ImageToTransform(contentName string, images image.Image) string
- func InitDataBase() error
- func InitUserWalletDataBase()
- func InsertUserDataModifier(userData MaiStructSQL) error
- func IsDark(rgb color.RGBA) bool
- func LimitByUser(ctx *nano.Ctx) *rate.Limiter
- func LoadFontFace(filePath string, size float64) font.Face
- func LoadPictureWithResize(link string, w int, h int) image.Image
- func MessageArkSender(ctx *nano.Ctx, Tosender bool, ark *nano.MessageArk)
- func ModifyTotalAwakenFunction(fixedUsage TotalCountFunction)
- func ModifyUserAwakenFunction(fixedUsage AwakenFunction)
- func ModifyUserCoinFunction(fixedUsage CoinFunction)
- func RandSenderPerDayN(uid int64, n int) int
- func ResLoader(plugin string) string
- func ResReader(plugin string, insertDataFile string) (err bool, dataByte []byte)
- func Resize(image image.Image, w int, h int) image.Image
- func ReturnFontLocation() string
- func ReturnLucyMainDataIndex(pluginName string) string
- func SaveImage(img image.Image, path string)
- func SendArkCoverWithText(ctx *nano.Ctx, Tosender bool, image string, title string, content string, ...)
- func SendArkTextWithSmallerImage(ctx *nano.Ctx, toSender bool, image2 string, title string, content string, ...)
- func SplitChineseString(s string, length int) []string
- func SplitCommandTo(raw string, setCommandStopper int) (splitCommandLen int, splitInfo []string)
- func TransformLink(contentPlace string) string
- func UploadedCleaner()
- type AwakenFunction
- type CoinFunction
- type GeneralUserdatabase
- type MaiStructSQL
- type TotalCountFunction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindUserGenaralInfo ¶
func BreakWords ¶
BreakWords Reduce the length of strings, if out of range, use ".." instead.
func DownloadImage ¶
DownloadImage Simple Downloader.
func DrawBorderSimple ¶
func DrawBorderSimple(page *gg.Context, s string, x float64, y float64, inlineRGB color.Color, reverse bool)
DrawBorderSimple Simple Usage of draw Border
func DrawBorderString ¶
func DrawBorderString(page *gg.Context, s string, size int, x float64, y float64, ax float64, ay float64, inlineRGB color.Color, outlineRGB color.Color)
DrawBorderString GG Package Not support The string render, so I write this (^^)
func GetAverageColorAndMakeAdjust ¶
GetAverageColorAndMakeAdjust different from k-means algorithm,it uses origin plugin's algorithm.(Reduce the cost of average color usage.)
func GetBotSelfImage ¶
GetBotSelfImage Get User's Avatar from QGuild, Return Raw Image.
func GetUserAvatar ¶
GetUserAvatar Get User's Avatar from QGuild, Return Raw Image.
func GetUserInfoName ¶
GetUserInfoName Get Info Name, for it can satisfy QQ Onebot Code here.
func InitDataBase ¶
func InitDataBase() error
func InitUserWalletDataBase ¶
func InitUserWalletDataBase()
func InsertUserDataModifier ¶
func InsertUserDataModifier(userData MaiStructSQL) error
func LoadFontFace ¶
LoadFontFace load font face once before running, to work it quickly and save memory.
func LoadPictureWithResize ¶
LoadPictureWithResize Load Picture
func MessageArkSender ¶
func MessageArkSender(ctx *nano.Ctx, Tosender bool, ark *nano.MessageArk)
MessageArkSender User Should return ARK MESSAGE TYPE.
func ModifyTotalAwakenFunction ¶
func ModifyTotalAwakenFunction(fixedUsage TotalCountFunction)
func ModifyUserAwakenFunction ¶
func ModifyUserAwakenFunction(fixedUsage AwakenFunction)
func ModifyUserCoinFunction ¶
func ModifyUserCoinFunction(fixedUsage CoinFunction)
func ReturnLucyMainDataIndex ¶
ReturnLucyMainDataIndex Lucy's main Path here.
func SendArkCoverWithText ¶
func SplitChineseString ¶
SplitChineseString Split Chinese type chart, Used In maimai | CHUN Render.
func SplitCommandTo ¶
SplitCommandTo Split Command and Adjust To.
func TransformLink ¶
func UploadedCleaner ¶
func UploadedCleaner()
Types ¶
type AwakenFunction ¶
type AwakenFunction struct {
UserID uint64 `db:"userid"` // UserID For here.
AwakenTime int64 `db:"awaken"` // AwakenTime is for int64 UNIX.
SignDay string `db:"sign"` // SignDay Is for user to check today is signed.
}
AwakenFunction Use for Sign Function.
func QueryUserAwakenFunction ¶
func QueryUserAwakenFunction(queryID uint64) AwakenFunction
type CoinFunction ¶
type CoinFunction struct {
UserID uint64 `db:"userid"` // due to qq guild use longer id uint so change it.
Coin int64 `db:"coins"` // to return user real token.
Status bool `db:"status"` // check if user use protect mode or not.
}
func QueryUserCoinsFunction ¶
func QueryUserCoinsFunction(queryID uint64) CoinFunction
type GeneralUserdatabase ¶
type GeneralUserdatabase struct {
UserID uint64 `db:"userid"` // userID
UserName string `db:"username"` // UserName
}
GeneralUserdatabase For DivingFish Service
func QueryUserGeneralInfo ¶
func QueryUserGeneralInfo(userid uint64) GeneralUserdatabase
type MaiStructSQL ¶
type MaiStructSQL struct {
UserID uint64 `db:"userid"` // userID
Plate string `db:"plate"` // plate
Background string `db:"bg"` // bg
}
func QueryUserbaseMaiData ¶
func QueryUserbaseMaiData(userid uint64) MaiStructSQL
type TotalCountFunction ¶
type TotalCountFunction struct {
TimeDay string `db:"time"` // TimeDay Use "YYYYMMDD"
Count int64 `db:"Count"` // Count Count This Day How Many Users Logined.
}
func QueryTotalAwakenFunction ¶
func QueryTotalAwakenFunction() TotalCountFunction