dbots/internal/db/custom.go
2026-04-17 22:05:05 +02:00

43 lines
780 B
Go

package db
type InstallContext string
const (
InstallContextUser InstallContext = "user"
InstallContextGuild InstallContext = "guild"
)
func (c InstallContext) String() string {
return string(c)
}
func (c InstallContext) IsValid() bool {
switch c {
case InstallContextUser, InstallContextGuild:
return true
default:
return false
}
}
type BotStatus string
const (
BotStatusDeleted BotStatus = "deleted"
BotStatusPending BotStatus = "pending"
BotStatusRejected BotStatus = "rejected"
BotStatusApproved BotStatus = "approved"
)
func (s BotStatus) String() string {
return string(s)
}
func (s BotStatus) IsValid() bool {
switch s {
case BotStatusDeleted, BotStatusPending, BotStatusRejected, BotStatusApproved:
return true
default:
return false
}
}