model

package
v0.0.0-...-3765fb9 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CallbackTypeRefresh     = "Refresh"
	CallbackTypePassThrough = "PassThrough"
	CallbackTypeKick        = "Kick"

	CallbackTypeDonateWX     = "DonateWX"
	CallbackTypeDonateAlipay = "DonateAlipay"
)
View Source
const (
	UserLinkTemplate = `<a href="tg://user?id=%d">%s</a>`
	EnterRoomMsg     = `` /* 324-byte string literal not displayed */

	HelpMsg = `` /* 307-byte string literal not displayed */

	DonateMsg = `所捐款项将用于:
1. 作者的续命咖啡 ☕️
2. 支付服务器等设施费用`
)
View Source
const (
	DefaultCaptchaExpire   = 300 * time.Second
	DefaultRefreshDuration = 75 * time.Second
)
View Source
const (
	TaskTypeDeleteMsg       = "DeleteMsg"
	TaskTypeUpdateMsgExpire = "UpdateMsgExpire"
)
View Source
const (
	TaskStatusPlan = iota
	TaskStatusDoing
	TaskStatusDone
)

Variables

View Source
var Donates = map[string]DonateKV{
	CallbackTypeDonateWX: {
		Key: "微信",
		URL: "wxp://f2f0OWfabxt-G2eVGJuF9psyiEvqiL3u3gxB",
	},
	CallbackTypeDonateAlipay: {
		Key: "支付宝",
		URL: "https://qr.alipay.com/fkx00824kg0dc3tf1sf4c2e",
	},
}
View Source
var InlineKeyboard = tgbotapi.NewInlineKeyboardMarkup(
	[]tgbotapi.InlineKeyboardButton{
		tgbotapi.NewInlineKeyboardButtonData("刷新验证码", CallbackTypeRefresh),
		tgbotapi.NewInlineKeyboardButtonData("通过验证[管理员]", CallbackTypePassThrough),
	},
	[]tgbotapi.InlineKeyboardButton{
		tgbotapi.NewInlineKeyboardButtonData("踢出群组[管理员]", CallbackTypeKick),
	},
)

Functions

func DonatesKeyboard

func DonatesKeyboard(donateType string) tgbotapi.InlineKeyboardMarkup

Types

type BlackList

type BlackList struct {
	Id           int64
	GroupId      int64
	UserId       int
	IdiomId      int64
	Idiom        Idiom
	CaptchaMsgId int
	UserLink     string
	ExpireAt     time.Time
	DeletedAt    *time.Time `pg:",soft_delete"`
}

type DonateKV

type DonateKV struct {
	Key    string
	FileID string
	URL    string
}

type Idiom

type Idiom struct {
	Id           int64
	Derivation   string
	Example      string
	Explanation  string
	Pinyin       string
	Word         string
	Abbreviation string
	CaptchaImg   []byte `sql:"-"`
}

type InlineKeyboardButtons

type InlineKeyboardButtons []tgbotapi.InlineKeyboardButton

func (InlineKeyboardButtons) Len

func (iBtn InlineKeyboardButtons) Len() int

func (InlineKeyboardButtons) Less

func (iBtn InlineKeyboardButtons) Less(i, j int) bool

func (InlineKeyboardButtons) Swap

func (iBtn InlineKeyboardButtons) Swap(i, j int)

type Task

type Task struct {
	Id          int64
	Type        string
	Status      int64 `sql:",notnull"`
	RunAt       time.Time
	ChatID      int64
	MsgID       int
	BlackListId int64
}

Jump to

Keyboard shortcuts

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