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 AuthCreate(k, v string)
- func AuthDelete(k string)
- func AuthRead() (m map[string]string, err error)
- func BestAndAverageTimeConvert(b, a int) (bc, ac string)
- func BindUserInfoSave(userId string, userName, avatar null.String, uin int64) (err error)
- func GetAll() (err error)
- func GetScramble(s string) string
- func GetTop10Rank(event, region, rtype, gender 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 LearnUpdateZbot()
- func PBlockSave(guildId, userId, adminId string, ispblock bool, gmtModified time.Time) (err error)
- func PathExists(path string) bool
- func PluginNameToIntent(s string) intent
- func RankPersonHandler(s, rtype string) string
- 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 SubscribeCreate(k, v string)
- func SubscribeDelete(k string)
- func SubscribeRead() (m map[string]string, err error)
- func SwitchSave(guildId, channelId, adminId string, isCloseOrGuard int64, ...) (err error)
- func ToGetEvent(s string) string
- func ToGetGender(s string) string
- func ToGetRankInfo(s string) (event, region, rtype, gender string)
- func ToGetRegion(s string) string
- func ToGetScramble(s string) string
- func ToGetScrambleIndex(s string) int
- func ToGetType(s string) string
- func ToRank(s string) (event, region, rtype, gender string)
- 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 AuthSync
- type BindUserInfo
- type BindUserInfoSync
- type CompContent
- type CompOptions
- type CuberPrice
- type GetInfoResponse
- type GetRankResultInfo
- type GetTop10RankInfo
- type GetWcaResultResponse
- type Info
- type ItemList
- type JudgeKeys
- type JudgekeysSync
- type Learn
- type PBlock
- type PeopleInfo
- type PeopleRankInfo
- type RankBest
- type RankContinent
- type RankCountry
- type RankInfo
- type RankItemInfo
- type RankResult
- type RankWorld
- type Scramble
- type ServerAuthSet
- type ServerAuthSetSync
- type SubscribeSync
- type Switch
- type SwitchSync
- type TCuberPrice
- type TLearn
- type Top10RankInfo
- type UserInfo
- type WcaItemResult
- type WcaResult
Constants ¶
View Source
const ( PluginGuard intent = 1 << iota // 守卫 PluginLog PluginBlock // 个人屏蔽 PluginSwitch // 开关 PluginRepeat // 复读 PluginWCA // WCA PluginReply // 回复 PluginAdmin // 群管 PluginPrice // 查价 PluginScramble // 打乱 PluginRank // Rank PluginLearn // 频道学习 )
Variables ¶
View Source
var AIMap = make(map[string]string, 0)
View Source
var AllConfig = config.AllConfig()
View Source
var Db *sql.DB
View Source
var IMap = make(map[string]string, 0)
View Source
var IntentMap = map[intent]string{ PluginLog: "Log", PluginGuard: "守卫", PluginBlock: "屏蔽", PluginSwitch: "开关", PluginRepeat: "复读", PluginWCA: "WCA", PluginReply: "回复", PluginAdmin: "群管", PluginPrice: "查价", PluginScramble: "打乱", PluginRank: "Rank", 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{ "Log": PluginLog, "守卫": PluginGuard, "屏蔽": PluginBlock, "开关": PluginSwitch, "复读": PluginRepeat, "WCA": PluginWCA, "回复": PluginReply, "群管": PluginAdmin, "查价": PluginPrice, "打乱": PluginScramble, "Rank": PluginRank, "学习": PluginLearn, }
Functions ¶
func AchievementGetCount ¶
func AchievementSave ¶
func AuthCreate ¶
func AuthCreate(k, v string)
func AuthDelete ¶
func AuthDelete(k string)
func BindUserInfoSave ¶
func GetScramble ¶
func GetTop10Rank ¶
func IntentMean ¶
func IntentMean(intent intent) string
func JudgeIndex ¶
func LearnUpdateZbot ¶
func LearnUpdateZbot()
func PBlockSave ¶
func PathExists ¶
func PluginNameToIntent ¶
func PluginNameToIntent(s string) intent
func RankPersonHandler ¶
func RedisRemove ¶
func RedisRemove(key string)
func SubscribeCreate ¶
func SubscribeCreate(k, v string)
func SubscribeDelete ¶
func SubscribeDelete(k string)
func SubscribeRead ¶
func SwitchSave ¶
func ToGetEvent ¶
func ToGetGender ¶
func ToGetRankInfo ¶
func ToGetRegion ¶
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 BindUserInfo ¶
type BindUserInfo struct { Id int64 UserId string UserName null.String Avatar null.String Uin int64 }
func (*BindUserInfo) BindUserInfoCreate ¶
func (b *BindUserInfo) BindUserInfoCreate() (err error)
func (*BindUserInfo) BindUserInfoUpdate ¶
func (b *BindUserInfo) BindUserInfoUpdate() (err error)
type BindUserInfoSync ¶
type BindUserInfoSync struct { IsTrue bool UserInfo *BindUserInfo }
func BindUserInfoGet ¶
func BindUserInfoGet(userId string, uin int64) (buis BindUserInfoSync, 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 GetInfoResponse ¶
type GetInfoResponse struct { Code int32 `json:"code"` Data *Info `json:"data"` Message string `json:"message"` }
func SearchPeople ¶
func SearchPeople(nameOrId string) GetInfoResponse
type GetRankResultInfo ¶
type GetRankResultInfo struct { Code int32 `json:"code"` Data *RankResult `json:"data,omitempty"` Message string `json:"message"` }
type GetTop10RankInfo ¶
type GetTop10RankInfo struct { Code int32 `json:"code"` Data *Top10RankInfo `json:"data,omitempty"` Message string `json:"message"` }
type GetWcaResultResponse ¶
type Info ¶
type Info struct { Msg string `json:"msg"` PageLast bool `json:"pageLast"` PageEmpty bool `json:"pageEmpty"` Data []*PeopleInfo `json:"data"` 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 RankContinent ¶
type RankCountry ¶
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 RankItemInfo ¶
type RankItemInfo struct { EventId string `json:"eventId"` Best *RankBest `json:"best"` ContinentRank *RankContinent `json:"continentRank"` CountryRank *RankCountry `json:"countryRank"` WorldRank *RankWorld `json:"worldRank"` }
type RankResult ¶
type RankResult struct { PeopleInfo PeopleInfo `json:"info"` RankItemsResult []*RankItemInfo `json:"data"` }
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 SubscribeSync ¶
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 TLearn ¶
type TLearn struct { Id int64 Ask string GuildId string ChannelId null.String AdminId string Answer null.String GmtModified time.Time Pass bool }
func (*TLearn) LearnUpdateZbot ¶
type Top10RankInfo ¶
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 ¶
type WcaItemResult ¶
type WcaResult ¶
type WcaResult struct { PeopleInfo PeopleInfo `json:"info"` WcaItemsResult []*WcaItemResult `json:"data"` }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.