Documentation ¶
Index ¶
- Constants
- Variables
- func ADBUAIAS(userId, item string, session int) (err error)
- func ADBUAS(userId string, session int) (err error)
- func AchievementGetCount(item string, best, average, session int) (i, j int, err error)
- func AchievementSave(userId, userName string, avatar null.String, item string, ...) (err error)
- func BestAndAverageTimeConvert(b, a int) (bc, ac string)
- func GetAll() (err error)
- func GetScramble(s string) string
- func IDBGAN(guildId, channelId, item string) (err error)
- func IntentMean(intent intent) string
- func IsExist(groupId string) bool
- func ItemSave(guildId, channelId string, brand null.String, item string, price null.String, ...) (id int64, err error)
- func Judge(str string, key JudgeKeys) string
- func JudgeIndex(str string, key JudgeKeys) int
- func JudgeItem(str string, items []string) string
- func LDBGAA(guildId, channelId, ask string) (err error)
- func LearnSave(ask, guildId, channelId, adminId string, answer null.String, ...) (err error)
- func PBlockSave(guildId, userId, adminId string, ispblock bool, gmtModified time.Time) (err error)
- func PathExists(path string) bool
- func PluginNameToIntent(s string) intent
- func RedisGet(key string) ([]byte, error)
- func RedisRemove(key string)
- func RedisSet(key string, bw_set []byte)
- func SDBGIACI(guildId, channelId string) (err error)
- func SwitchSave(guildId, channelId, adminId string, isCloseOrGuard int64, ...) (err error)
- func ToGetScramble(s string) string
- func ToGetScrambleIndex(s string) int
- func UID(userid, email, qq_union_id, weixin_union_id string) error
- func UserInfoSave(...) (err error)
- func WcaPersonHandler(s string) string
- type Achievement
- func AGBIASOBAA(item string, session int) (as []Achievement, err error)
- func AGBIASOBBA(item string, session int) (bs []Achievement, err error)
- func AGBSOBIAAAA(session int) (as []Achievement, err error)
- func AGBSOBIAABA(session int) (as []Achievement, err error)
- func AGBUAS(userId string, session int) (as []Achievement, err error)
- func AchievementGet(userId, item string, session int) (a Achievement, err error)
- type CompContent
- type CompOptions
- type CuberPrice
- type Info
- type JudgeKeys
- type JudgekeysSync
- type Learn
- type PBlock
- type PeopleInfo
- type PeopleRankInfo
- type RankInfo
- type Scramble
- type ServerAuthSet
- type ServerAuthSetSync
- type Switch
- type SwitchSync
- type TCuberPrice
- type UserInfo
Constants ¶
View Source
const ( PluginGuard intent = 1 << iota // 守卫 PluginBlock // 个人屏蔽 PluginSwitch // 开关 PluginRepeat // 复读 PluginWCA // WCA PluginReply // 回复 PluginAdmin // 频道管理 PluginPrice // 查价 PluginScramble // 打乱 PluginLearn // 频道学习 )
Variables ¶
View Source
var AllConfig = config.AllConfig()
View Source
var Db *sql.DB
View Source
var IntentMap = map[intent]string{ PluginGuard: "守卫", PluginBlock: "屏蔽", PluginSwitch: "开关", PluginRepeat: "复读", PluginWCA: "WCA", PluginReply: "回复", PluginAdmin: "频道管理", PluginPrice: "查价", PluginScramble: "打乱", PluginLearn: "学习", }
View Source
var Pool *redis.Pool
View Source
var ScrambleIndexMap = map[string]int{
"1": 1,
"2": 2,
"3": 3,
"4": 4,
"5": 5,
}
View Source
var ScrambleMap = map[string]string{
"2": "222",
"3": "333",
"4": "444",
"5": "555",
"6": "666",
"7": "777",
"sk": "skewb",
"py": "pyram",
"sq": "sq1",
"cl": "clock",
"mx": "minx",
"fm": "333fm",
"222": "222",
"333": "333",
"444": "444",
"555": "555",
"666": "666",
"777": "777",
"skewb": "skewb",
"pyram": "pyram",
"sq1": "sq1",
"clock": "clock",
"minx": "minx",
"333fm": "333fm",
}
View Source
var SwitchMap = map[string]intent{ "守卫": PluginGuard, "屏蔽": PluginBlock, "开关": PluginSwitch, "复读": PluginRepeat, "WCA": PluginWCA, "回复": PluginReply, "频道管理": PluginAdmin, "查价": PluginPrice, "打乱": PluginScramble, "学习": PluginLearn, }
Functions ¶
func AchievementGetCount ¶
func AchievementSave ¶
func GetScramble ¶
func IntentMean ¶
func IntentMean(intent intent) string
func JudgeIndex ¶
func PBlockSave ¶
func PathExists ¶
func PluginNameToIntent ¶
func PluginNameToIntent(s string) intent
func RedisRemove ¶
func RedisRemove(key string)
func SwitchSave ¶
func ToGetScramble ¶
func ToGetScrambleIndex ¶
func UserInfoSave ¶
func WcaPersonHandler ¶
Types ¶
type Achievement ¶
type Achievement struct { Id int64 UserId string UserName string Avatar null.String Item string Best int Average int Session int }
func AGBIASOBAA ¶
func AGBIASOBAA(item string, session int) (as []Achievement, err error)
AchievementGetByItemAndSessionOrderByAverageAsc desc 大 → 小 asc 小 → 大
func AGBIASOBBA ¶
func AGBIASOBBA(item string, session int) (bs []Achievement, err error)
AchievementGetByItemAndSessionOrderByBestAsc desc 大 → 小 asc 小 → 大
func AGBSOBIAAAA ¶
func AGBSOBIAAAA(session int) (as []Achievement, err error)
AchievementGetBySessionOrderByItemAscAndAverageAsc desc 大 → 小 asc 小 → 大
func AGBSOBIAABA ¶
func AGBSOBIAABA(session int) (as []Achievement, err error)
AchievementGetBySessionOrderByItemAscAndBestAsc desc 大 → 小 asc 小 → 大
func AGBUAS ¶
func AGBUAS(userId string, session int) (as []Achievement, err error)
AchievementGetByUserIdAndSession
func AchievementGet ¶
func AchievementGet(userId, item string, session int) (a Achievement, err error)
func (*Achievement) AchievementCreate ¶
func (a *Achievement) AchievementCreate() (err error)
func (*Achievement) AchievementUpdate ¶
func (a *Achievement) AchievementUpdate() (err error)
type CompContent ¶
type CompContent struct { Two string Three string Four string Five string Six string Seven string Skewb string Pyraminx string Square string Megaminx string Clock string }
func GetScrambles ¶
func GetScrambles(s []string, n int) (string, CompContent, error)
type CompOptions ¶
type CompOptions struct { Sessions int StartTime int64 EndTime int64 Items []string CompContents *CompContent }
func CompetitionRead ¶
func CompetitionRead() (c CompOptions, err error)
func (*CompOptions) CompetitionCreate ¶
func (c *CompOptions) CompetitionCreate(day int, si []string) (err error)
func (*CompOptions) CompetitionUpdate ¶
func (c *CompOptions) CompetitionUpdate(sa []string) (tip string, err error)
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 null.String `json:"updater"` GmtModified int64 `json:"gmt_modified"` IsMagnetism bool `json:"is_magnetism"` MagnetismType null.String `json:"magnetism_type"` }
func GetItem ¶
func GetItem(guildId, channelId string, item string) (cp CuberPrice, err error)
is_magnetism
func GetItemsAll ¶
func GetItemsAll(guildId, channelId string) (cps []CuberPrice, err error)
func (*CuberPrice) ItemCreate ¶
func (cp *CuberPrice) ItemCreate() (id int64, err error)
func (*CuberPrice) ItemDeleteById ¶
func (cp *CuberPrice) ItemDeleteById() (err error)
func (*CuberPrice) ItemUpdate ¶
func (cp *CuberPrice) ItemUpdate() (err error)
type Info ¶
type Info struct { Msg string `json:"msg"` PageLast bool `json:"pageLast"` PageEmpty bool `json:"pageEmpty"` Data []PeopleInfo TotalPages int `json:"totalPages"` PageFirst bool `json:"pageFirst"` PageSize int `json:"pageSize"` PageNumberOfElements int `json:"pageNumberOfElements"` PageNum int `json:"pageNum"` Retcode int `json:"retcode"` TotalElements int `json:"totalElements"` }
type JudgeKeys ¶
type JudgeKeys struct {
Keys []string
}
func JudgeKeysRead ¶
func (*JudgeKeys) JudgeKeysCreate ¶
type JudgekeysSync ¶
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 GuildId string ChannelId string AdminId string Answer null.String GmtModified time.Time Pass bool }
func (*Learn) LDBGIAAACI ¶
LearnDeleteByGuildIdAndAskAndChannelId
func (*Learn) LearnCreate ¶
func (*Learn) LearnUpdate ¶
type PBlock ¶
type PBlock struct { Id int `json:"id"` GuildId string `json:"guild_id"` UserId string `json:"user_id"` IsPBlock bool `json:"ispblock"` AdminId string `json:"admin_id"` GmtModified time.Time `json:"gmt_modified"` }
func (*PBlock) PBlockCreate ¶
func (*PBlock) PBlockUpdate ¶
type PeopleInfo ¶
type PeopleRankInfo ¶
type RankInfo ¶
type RankInfo struct { Msg string `json:"msg"` PageLast bool `json:"pageLast"` PageEmpty bool `json:"pageEmpty"` Data []PeopleRankInfo TotalPages int `json:"totalPages"` PageFirst bool `json:"pageFirst"` PageSize int `json:"pageSize"` PageNumberOfElements int `json:"pageNumberOfElements"` PageNum int `json:"pageNum"` Retcode int `json:"retcode"` TotalElements int `json:"totalElements"` }
type ServerAuthSet ¶
type ServerAuthSet struct {
Groups []string
}
func ServerAuthsRead ¶
func ServerAuthsRead() (s ServerAuthSet, err error)
func (*ServerAuthSet) ServerAuthsSet ¶
func (s *ServerAuthSet) ServerAuthsSet() error
type ServerAuthSetSync ¶
type ServerAuthSetSync struct { IsTrue bool ServerAuthSetSync *ServerAuthSet }
func ServerAuthsGet ¶
func ServerAuthsGet() (s ServerAuthSetSync, err error)
func (*ServerAuthSetSync) ServerAuthUpdate ¶
func (s *ServerAuthSetSync) ServerAuthUpdate(groupId string) error
func (*ServerAuthSetSync) ServerAuthsDelete ¶
func (s *ServerAuthSetSync) ServerAuthsDelete(groupId string)
type Switch ¶
type Switch struct { Id int `json:"id"` GuildId string `json:"guild_id"` ChannelId string `json:"channel_id"` IsCloseOrGuard int64 `json:"is_close_or_guard"` AdminId string `json:"admin_id"` GmtModified time.Time `json:"gmt_modified"` }
func (*Switch) SwitchCreate ¶
func (*Switch) SwitchUpdate ¶
type SwitchSync ¶
func SGBGIACI ¶
func SGBGIACI(guildId, channelId string) (bot_switch_sync SwitchSync, err error)
SGBGI SwitchGetByGuildIdAndChannelId
type TCuberPrice ¶
type TCuberPrice 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 null.String `json:"updater"` GmtModified null.Time `json:"gmt_modified"` IsMagnetism bool `json:"is_magnetism"` MagnetismType null.String `json:"magnetism_type"` }
type UserInfo ¶
type UserInfo struct { Id int64 `json:"id"` UserId null.String `json:"user_id"` Username null.String `json:"user_name"` UserRole int `json:"user_role"` // 1<<1 黄小姐 1<<2 奇乐 1<<30 系统 UserAvatar null.String `json:"user_avatar"` ServerNumber null.String `json:"server_number"` Password null.String `json:"password"` Email null.String `josn:"email"` QQUnionId null.String `json:"qq_union_id"` WeixinUnionId null.String `json:"weixin_union_id"` }
func UserInfoGet ¶
func UserInfoGetByBot ¶
func (*UserInfo) UserInfoDelete ¶
func (*UserInfo) UserInfoUpdate ¶
Click to show internal directories.
Click to hide internal directories.