public

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const DingTalkClientIdKeyName = "DingTalkClientId"

Variables

View Source
var Prompt *[]config.Prompt

Functions

func CheckRequest added in v1.0.4

func CheckRequest(ts, sg string) bool

func CheckRequestWithCredentials added in v1.0.20

func CheckRequestWithCredentials(ts, sg string) (clientId string, pass bool)

func FirstCheck added in v0.1.3

func FirstCheck(rmsg *dingbot.ReceiveMsg) bool

func GetBalance added in v0.1.4

func GetBalance() (string, error)

GetBalance 获取账号余额

func GetReadTime added in v1.0.10

func GetReadTime(t time.Time) string

func InitAiCli added in v0.1.4

func InitAiCli() *resty.Client

func InitSvc added in v0.1.3

func InitSvc()

func JudgeAdminUsers added in v1.0.7

func JudgeAdminUsers(s string) bool

JudgeAdminUsers 判断用户是否为系统管理员

func JudgeGroup added in v1.0.7

func JudgeGroup(s string) bool

JudgeGroup 判断群ID是否在白名单

func JudgeOutgoingGroup added in v1.0.15

func JudgeOutgoingGroup(s string) bool

JudgeOutgoingGroup 判断群ID是否在为outgoing白名单

func JudgeSensitiveWord added in v1.0.17

func JudgeSensitiveWord(s string) bool

JudgeSensitiveWord 判断内容是否包含敏感词

func JudgeUsers added in v1.0.7

func JudgeUsers(s string) bool

JudgeUsers 判断用户是否在白名单

func JudgeVipUsers added in v1.0.14

func JudgeVipUsers(s string) bool

JudgeVipUsers 判断用户是否为VIP用户

func SolveSensitiveWord added in v1.0.17

func SolveSensitiveWord(s string) string

SolveSensitiveWord 将敏感词用 🚫 占位

func WriteToFile added in v1.0.7

func WriteToFile(path string, data []byte) error

将内容写入到文件,如果文件名带路径,则会判断路径是否存在,不存在则创建

Types

type Bill added in v1.0.13

type Bill struct {
	Object     string      `json:"object"`
	DailyCosts []DailyCost `json:"daily_costs"`
	TotalUsage float64     `json:"total_usage"`
}

type DailyCost added in v1.0.13

type DailyCost struct {
	Timestamp float64    `json:"timestamp"`
	LineItems []LineItem `json:"line_items"`
}

type LineItem added in v1.0.13

type LineItem struct {
	Name string  `json:"name"`
	Cost float64 `json:"cost"`
}

type Plan added in v1.0.13

type Plan struct {
	Title string `json:"title"`
	ID    string `json:"id"`
}

type Subscription added in v1.0.13

type Subscription struct {
	Object             string      `json:"object"`
	HasPaymentMethod   bool        `json:"has_payment_method"`
	Canceled           bool        `json:"canceled"`
	CanceledAt         interface{} `json:"canceled_at"`
	Delinquent         interface{} `json:"delinquent"`
	AccessUntil        int64       `json:"access_until"`
	SoftLimit          int64       `json:"soft_limit"`
	HardLimit          int64       `json:"hard_limit"`
	SystemHardLimit    int64       `json:"system_hard_limit"`
	SoftLimitUsd       float64     `json:"soft_limit_usd"`
	HardLimitUsd       float64     `json:"hard_limit_usd"`
	SystemHardLimitUsd float64     `json:"system_hard_limit_usd"`
	Plan               Plan        `json:"plan"`
	AccountName        string      `json:"account_name"`
	PoNumber           interface{} `json:"po_number"`
	BillingEmail       interface{} `json:"billing_email"`
	TaxIDS             interface{} `json:"tax_ids"`
	BillingAddress     interface{} `json:"billing_address"`
	BusinessAddress    interface{} `json:"business_address"`
}

func GetSub added in v1.0.13

func GetSub() (Subscription, error)

Jump to

Keyboard shortcuts

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