data

package
v0.0.0-...-f191df0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PluginGuard     intent = 1 << iota // 守卫
	PluginBlock                        // 个人屏蔽
	PluginSwitch                       // 开关
	PluginRepeat                       // 复读
	PluginReply                        // 回复
	PluginAdmin                        // 群管
	PluginSubscribe                    //查价订阅
	PluginPrice                        // 查价
	PluginScramble                     // 打乱
	PluginLearn                        // 群学习
)

Variables

View Source
var Db *sql.DB
View Source
var IntentMap = map[intent]string{
	PluginGuard:     "守卫",
	PluginBlock:     "屏蔽",
	PluginSwitch:    "开关",
	PluginRepeat:    "复读",
	PluginReply:     "回复",
	PluginAdmin:     "群管",
	PluginSubscribe: "订阅",
	PluginPrice:     "查价",
	PluginScramble:  "打乱",
	PluginLearn:     "学习",
}
View Source
var Pool *redis.Pool
View Source
var SwitchMap = map[string]intent{
	"守卫": PluginGuard,
	"屏蔽": PluginBlock,
	"开关": PluginSwitch,
	"复读": PluginRepeat,
	"回复": PluginReply,
	"群管": PluginAdmin,
	"订阅": PluginSubscribe,
	"查价": PluginPrice,
	"打乱": PluginScramble,
	"学习": PluginLearn,
}

Functions

func GetScramble

func GetScramble(s string) string

func IDBGAN

func IDBGAN(guildId, channelId, item string) (err error)

ItemDeleteByGuildIdAndName

func IntentMean

func IntentMean(intent intent) string

func ItemSave

func ItemSave(guildId, channelId string, brand null.String, item string, price null.String, shipping null.String, updater string, gmtModified null.Time) (err error)

func Judge

func Judge(str string, key JudgeKeys) string

func JudgeIndex

func JudgeIndex(str string, key JudgeKeys) int

func LDBGAA

func LDBGAA(groupId int64, ask string) (err error)

func LearnSave

func LearnSave(ask string, groupId int64, adminId int64, answer null.String, gmtModified time.Time) (err error)

func PBlockSave

func PBlockSave(userId int64, ispblock bool, adminId int64, gmtModified time.Time) (err error)

func PluginNameToIntent

func PluginNameToIntent(s string) intent

func SDBGI

func SDBGI(groupId int64) (err error)

SDBGI SwitchDeleteByGroupId

func SubDeleteByGroupId

func SubDeleteByGroupId(groupId int64) (err error)

func SubSave

func SubSave(orgin_group_id int64, replace_group_id int64, admin_id int64) (err error)

func SwitchSave

func SwitchSave(groupId int64, isCloseOrGuard int64, isClose bool) (err error)

Types

type CuberPrice

type CuberPrice struct {
	Id          int64       `json:"id"`
	GuildId     string      `json:"guild_id"`
	ChannelId   string      `json:"channel_id"`
	Brand       null.String `json:"brand"`
	Item        string      `json:"item"`
	Price       null.String `json:"price"`
	Shipping    null.String `json:"shipping"`
	Updater     string      `json:"updater"`
	GmtModified null.Time   `json:"gmt_modified"`
}

func GetItem

func GetItem(guildId, channelId string, item string) (cp CuberPrice, err error)

func GetItems

func GetItems(guildId, channelId string, key string) (cps []CuberPrice, err error)

func (*CuberPrice) ItemCreate

func (cp *CuberPrice) ItemCreate() (err error)

func (*CuberPrice) ItemDeleteById

func (cp *CuberPrice) ItemDeleteById() (err error)

func (*CuberPrice) ItemUpdate

func (cp *CuberPrice) ItemUpdate(price null.String, shipping null.String) (err error)

type JudgeKeys

type JudgeKeys struct {
	Keys []string
}

func JudgeKeysRead

func JudgeKeysRead() (k JudgeKeys, err error)

func (*JudgeKeys) JudgeKeysCreate

func (k *JudgeKeys) JudgeKeysCreate() error

type JudgekeysSync

type JudgekeysSync struct {
	IsTrue        bool
	JudgekeysSync *JudgeKeys
}

func GetJudgeKeys

func GetJudgeKeys() (key JudgekeysSync, err error)

func (*JudgekeysSync) JudgeKeysDelete

func (k *JudgekeysSync) JudgeKeysDelete(dk ...string)

func (*JudgekeysSync) JudgeKeysUpdate

func (k *JudgekeysSync) JudgeKeysUpdate(uk ...string) error

type Learn

type Learn struct {
	Id          int64
	Ask         string
	GroupId     int64
	AdminId     int64
	Answer      null.String
	GmtModified time.Time
}

func (*Learn) LearnCreate

func (learn *Learn) LearnCreate() (err error)

func (*Learn) LearnDeleteByGroupIdAndAsk

func (learn *Learn) LearnDeleteByGroupIdAndAsk() (err error)

func (*Learn) LearnUpdate

func (learn *Learn) LearnUpdate(answer null.String) (err error)

type LearnSync

type LearnSync struct {
	IsTrue    bool
	LearnSync *Learn
}

func LearnGet

func LearnGet(groupId int64, ask string) (learnSync LearnSync, err error)

type PBlock

type PBlock struct {
	Id          int
	UserId      int64
	IsPBlock    bool
	AdminId     int64
	GmtModified time.Time
}

func (*PBlock) PBlockCreate

func (pBlock *PBlock) PBlockCreate() (err error)

func (*PBlock) PBlockUpdate

func (pBlock *PBlock) PBlockUpdate(ispblock bool) (err error)

type PBlockSync

type PBlockSync struct {
	IsTrue     bool
	PBlockSync *PBlock
}

func PBlockGet

func PBlockGet(userId int64) (pblockSync PBlockSync, err error)

type Scramble

type Scramble struct {
	Instruction string
	ShortName   string
	ShowName    string
}

func Tnoodle

func Tnoodle(scramble string) (s Scramble)

type Subscribe

type Subscribe struct {
	Id             int64
	OriginGroupId  int64
	ReplaceGroupId int64
	AdminId        int64
}

func (*Subscribe) SubCreate

func (sub *Subscribe) SubCreate() (err error)

func (*Subscribe) SubDelete

func (sub *Subscribe) SubDelete() (err error)

func (*Subscribe) SubUpdate

func (sub *Subscribe) SubUpdate(replace_group_id int64) (err error)

type SubscribeSync

type SubscribeSync struct {
	IsTrue  bool
	SubSync *Subscribe
}

func GetSubscribe

func GetSubscribe(groupId int64) (sub_sync SubscribeSync, err error)

type Switch

type Switch struct {
	Id             int   `json:"id"`
	GroupId        int64 `json:"group_id"`
	IsCloseOrGuard int64 `json:"is_close_or_guard"`
}

func (*Switch) SwitchCreate

func (bot_switch *Switch) SwitchCreate() (err error)

func (*Switch) SwitchUpdate

func (bot_switch *Switch) SwitchUpdate(isCloseOrGuard int64) (err error)

type SwitchSync

type SwitchSync struct {
	IsTrue       bool `json:"synchronization"`
	PluginSwitch *Switch
}

func SGBGI

func SGBGI(groupId int64) (bot_switch_sync SwitchSync, err error)

SGBGI SwitchGetByGroupId

Jump to

Keyboard shortcuts

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