Documentation
¶
Index ¶
- Constants
- Variables
- func Deta() *deta.Deta
- func GetBlacklists() ([]string, error)
- func GetWhitelists() ([]string, error)
- func HandleRole(session *discordgo.Session, userid string, guildId string, dps int) error
- func SendLog(sendlog *LogProps)
- func StopUser(userid string, wallet string) error
- func UnlinkUser(userid string, wallet string, userSession UserSession, reason string) error
- func UpdateUserData(userid string) error
- func UpdateUserDps(userid string, dps DPSProps, wallet string) error
- func UsersBase() *base.Base
- func UsersDpsBase() *base.Base
- func WebLoginBase() *base.Base
- type DPSItemsProps
- type DPSProps
- type DPSStats
- type LogProps
- type LogType
- type User
- type UserDpsProps
- type UserSession
- type WebLoginUserProps
- type WhitelistResponseProps
Constants ¶
View Source
const ( LogTypeError = "error" LogTypeInfo = "info" )
View Source
const ( LogErrorColor = 15548997 LogInfoColor = 3447003 )
View Source
const PupsAboveAll = 35000
View Source
const PupsApocalypse = 20000
View Source
const PupsDoggosOfEternity = 100000
View Source
const PupsDoggosOfInfinity = 60000
View Source
const PupsKnight = 5000
View Source
const PupsOverlord = 10000
View Source
const PupsWarrior = 3000
Variables ¶
View Source
var ( GUILD = strings.Split(os.Getenv("GUILD"), ",") TOKEN = os.Getenv("TOKEN") DEV = os.Getenv("DEV") == "true" IS_TESTNET = os.Getenv("IS_TESTNET") == "true" ADVENTURE_ROLE = os.Getenv("ADVENTURE_ROLE") InitRoles = strings.Split(os.Getenv("ROLES"), ",") ALL_ROLES = append(InitRoles, ADVENTURE_ROLE) MOD_ROLE = os.Getenv("MOD_ROLE") ADMIN_ROLE = os.Getenv("ADMIN_ROLE") VERIFIED_ROLE = os.Getenv("VERIFIED_ROLE") WHITELIST_API = os.Getenv("GALLERY_WHITELIST_API") WHITELIST_API_KEY = os.Getenv("GALLERY_WHITELIST_KEY") WEBHOOKLOGS_API = os.Getenv("WEBHOOK_LOGS") )
View Source
var AllRoles = []string{
"Warrior Pups",
"Knight Pups",
"Overlord Pups",
"Pups of the Apocalypse",
"Pups Above All",
"Doggos of Infinity",
"Doggos of Eternity",
}
AllRoles is the list of all available roles for ranking.
View Source
var Atom, _ = atomicassets.NewCustom("https://wax-aa.eosdac.io/atomicassets/v1", &http.Client{})
View Source
var Colors = map[string]string{
"purple": "#a652bb",
"blue": "#3b6fff",
"cyan": "#00c09a",
"green": "#00d166",
"gold": "#fff000",
"red": "#e61616",
"orange": "#ffa500",
"white": "#ffffff",
"grey": "#95a5a6",
}
View Source
var Roles = map[int]DPSStats{ PupsWarrior: { Title: "Warrior Pups", RoleID: InitRoles[0], Color: "green", }, PupsKnight: { Title: "Knight Pups", RoleID: InitRoles[1], Color: "blue", }, PupsOverlord: { Title: "Overlord Pups", RoleID: InitRoles[2], Color: "purple", }, PupsApocalypse: { Title: "Pups of the Apocalypse", RoleID: InitRoles[3], Color: "red", }, PupsAboveAll: { Title: "Pups Above All", RoleID: InitRoles[4], Color: "orange", }, PupsDoggosOfInfinity: { Title: "Doggos of Infinity", RoleID: InitRoles[5], Color: "gold", }, PupsDoggosOfEternity: { Title: "Doggos of Eternity", RoleID: InitRoles[6], Color: "white", }, }
Roles is the roles and
Functions ¶
func GetBlacklists ¶
func GetWhitelists ¶
func HandleRole ¶
promotes the user with his/her dps stats
func UnlinkUser ¶
func UnlinkUser(userid string, wallet string, userSession UserSession, reason string) error
remove the user from the whitelist remove `Linked Pup` role of user params:
- userid: user's discord id
- wallet: users' wallet
- userExists: checker if user exists or not and use
- reason: reason user is unlinked, useful for admin dashboard
func UpdateUserDps ¶
updates the user's dps
Types ¶
type DPSItemsProps ¶
type DPSProps ¶
type DPSProps struct {
PupSkinCards int `json:"pupskincards"`
PuppyCards int `json:"puppycards"`
PupItems DPSItemsProps `json:"pupitems"`
}
type DPSStats ¶
func GetDPSRoleInfo ¶
GetDPSRoleInfo gets the role info for a specific DPS.
type User ¶
type User struct {
Key string `json:"key"`
ID string `json:"id"`
Wallet string `json:"wallet"`
Token string `json:"token"`
IsStopped bool `json:"is_stopped"`
IsWhitelisted bool `json:"is_whitelisted"`
NotWhitelistedReason string `json:"not_whitelisted_reason"`
}
type UserDpsProps ¶
type UserSession ¶
type WebLoginUserProps ¶
type WebLoginUserProps struct {
Key string `json:"key"`
Token string `json:"token"`
Type string `json:"type"`
Wallet string `json:"wallet"`
Linked bool `json:"linked,omitempty"`
}
func FetchWebLoginToken ¶
func FetchWebLoginToken(token string) WebLoginUserProps
gets the wallet with the token
type WhitelistResponseProps ¶
type WhitelistResponseProps struct {
Wallet string `json:"wallet"`
TransactionId string `json:"transaction_id"`
}
func AddWhitelist ¶
func AddWhitelist(wallet string) (WhitelistResponseProps, error)
func RemoveWhitelist ¶
func RemoveWhitelist(wallet string) (WhitelistResponseProps, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.