Versions in this module Expand all Collapse all v0 v0.5.0 May 3, 2024 Changes in this version type Bot + Innovations []*Innovation + Name string + Version *Version + type BotData struct + Name string + Version string + func (b *BotData) Load() error + func (b *BotData) Save() error + type Innovation struct + Commands *InnovationCommands + Version *Version + func LoadInnovationFromJson(b []byte) ([]*Innovation, error) + type InnovationCommands struct + Added []string + Removed []string + Updated []string + func GetCommandsUpdate(bot *Bot) *InnovationCommands + type Version struct + Major uint + Minor uint + Patch uint + PreRelease string + func ParseVersion(s string) (*Version, error) + func (v *Version) ForSort(o *Version) int + func (v *Version) Is(o *Version) bool + func (v *Version) NewerThan(o *Version) bool + func (v *Version) SetMajor(m uint) *Version + func (v *Version) SetMinor(m uint) *Version + func (v *Version) SetPatch(p uint) *Version + func (v *Version) SetPreRelease(p string) *Version + func (v *Version) String() string + func (v *Version) UpdateBotVersion(bot *Bot) v0.4.0 Apr 27, 2024 Changes in this version type GeneralCommand + func (c *GeneralCommand) Is(cmd *discordgo.ApplicationCommand) bool v0.4.0-1 Apr 27, 2024 v0.3.0 Apr 18, 2024 Changes in this version + type DataBase interface + Load func() error + Save func() error + type RedisBase interface + GenKey func(key string) string + type RedisUser struct + DiscordID string + GuildID string + func (p *RedisUser) GenKey(key string) string v0.2.1 Apr 15, 2024 v0.2.0 Apr 15, 2024 v0.1.6 Apr 15, 2024 v0.1.5 Apr 14, 2024 Changes in this version type Bot + AfterInit func(s *discordgo.Session) v0.1.4 Apr 14, 2024 Changes in this version type Bot + Session *discordgo.Session v0.1.3 Apr 14, 2024 v0.1.2 Apr 14, 2024 Changes in this version + const ConfigFolder v0.1.1 Apr 14, 2024 v0.1.0 Apr 14, 2024 Changes in this version + const AdminPermission + const GameStatus + const ListeningStatus + const StreamingStatus + const WatchStatus + var BaseCfg BaseConfig + var DB *gorm.DB + var Debug bool + var DefaultBaseConfig string + var ErrBadStatusType = errors.New("bad status type, please use the constant") + var ErrGuildIDDiscordIDNotPresent = errors.New("guild_id or discord_id not informed") + var ErrImpossibleToConnectDB = errors.New("impossible to connect to the database") + var ErrImpossibleToConnectRedis = errors.New("impossible to connect to redis") + var ErrNilClient = errors.New("redis.NewClient is nil") + var ErrStatusUrlNotFound = errors.New("status url not found") + var ErrSubsAreNil = errors.New("subs are nil in general handler") + func Get(cfg any, defaultConfig string, name string) error + func SetupConfigs(cfgInfo []ConfigInfo) error + type BaseConfig struct + Author string + Database DatabaseCredentials + Debug bool + Redis RedisCredentials + type Bot struct + Commands []*Cmd + Handlers []interface{} + Status []*Status + Token string + func (b *Bot) Start() + type Cmd struct + Handler func(s *discordgo.Session, i *discordgo.InteractionCreate) + Subs []*SimpleSubCmd + type ConfigInfo struct + Cfg any + Default string + Name string + type DatabaseCredentials struct + DBName string + Host string + Password string + Port int + User string + func (dc *DatabaseCredentials) Connect() (*gorm.DB, error) + type GCommandChoice struct + Name string + Value interface{} + func NewChoice(name string, value interface{}) *GCommandChoice + func (c *GCommandChoice) ToDiscordChoice() *discordgo.ApplicationCommandOptionChoice + type GCommandOption struct + Choices []*GCommandChoice + Description string + Name string + Required bool + Type discordgo.ApplicationCommandOptionType + func NewOption(t discordgo.ApplicationCommandOptionType, name string, description string) *GCommandOption + func (o *GCommandOption) AddChoice(c *GCommandChoice) *GCommandOption + func (o *GCommandOption) IsRequired() *GCommandOption + func (o *GCommandOption) ToDiscordOption() *discordgo.ApplicationCommandOption + type GeneralCommand struct + CanDM bool + Description string + Handler func(s *discordgo.Session, i *discordgo.InteractionCreate) + HasSub bool + IsSub bool + Name string + Options []*GCommandOption + Permission int64 + Subs []*GeneralCommand + func NewCommand(name string, description string) *GeneralCommand + func (c *GeneralCommand) AddOption(s *GCommandOption) *GeneralCommand + func (c *GeneralCommand) AddSub(s *GeneralCommand) *GeneralCommand + func (c *GeneralCommand) ContainsSub() *GeneralCommand + func (c *GeneralCommand) DM() *GeneralCommand + func (c *GeneralCommand) HasOption() *GeneralCommand + func (c *GeneralCommand) SetHandler(handler func(s *discordgo.Session, i *discordgo.InteractionCreate)) *GeneralCommand + func (c *GeneralCommand) SetPermission(p int64) *GeneralCommand + func (c *GeneralCommand) ToCmd() *Cmd + func (c *GeneralCommand) ToSubCmd() *SubCmd + type RedisCredentials struct + Address string + DB int + Password string + var Credentials RedisCredentials + var Ctx = context.Background() + func (rc *RedisCredentials) Get() (*redis.Client, error) + type SimpleSubCmd struct + Handler func(s *discordgo.Session, i *discordgo.InteractionCreate) + Name string + type Status struct + Content string + Type int + Url string + type SubCmd struct + Handler func(s *discordgo.Session, i *discordgo.InteractionCreate) + func (s *SubCmd) ToSimple() *SimpleSubCmd + type UserBase struct + DiscordID string + GuildID string + func (p *UserBase) GenKey() string