bot

package
v1.4.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2021 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GuildID string = ""

Functions

func SetLogLevel

func SetLogLevel(l string)

Types

type Audio

type Audio struct {
	Buffer *[][]byte
}

type Bot

type Bot struct {
	AuthToken    string
	Config       *viper.Viper
	Audio        map[string]Audio
	AudioMutex   *sync.Mutex
	HttpClient   *http.Client
	Db           *gorm.DB
	Session      *discordgo.Session
	AnnounceChan *discordgo.Channel
	TMDb         *tmdb.TMDb
	OwmClient    *owm.Client
	StartTime    time.Time
}

func NewBot

func NewBot(c *viper.Viper) Bot

func (*Bot) BotReadyHandler

func (b *Bot) BotReadyHandler(s *discordgo.Session, ev *discordgo.Ready)

func (*Bot) CheckRatCookies added in v1.4.7

func (b *Bot) CheckRatCookies()

func (*Bot) CollectSummaryData added in v1.4.7

func (b *Bot) CollectSummaryData(userId ...string) error

func (*Bot) CommandHandler added in v1.4.0

func (b *Bot) CommandHandler(s *discordgo.Session, m *discordgo.MessageCreate)

Let's the bot tell you the current date/time when requested via !time command

func (*Bot) GetEncryptionKey added in v1.4.4

func (b *Bot) GetEncryptionKey() error

func (*Bot) ResetSlashCmds added in v1.4.6

func (b *Bot) ResetSlashCmds()

func (*Bot) Run

func (b *Bot) Run()

func (*Bot) SlashCmdHandler added in v1.4.6

func (b *Bot) SlashCmdHandler(s *discordgo.Session, i *discordgo.InteractionCreate)

SlashCmdHandler handles all incoming slash commands. It creates a general user object and forward the command data to the corresponding handler submethod

func (*Bot) SlashCmdList added in v1.4.6

func (b *Bot) SlashCmdList() []*discordgo.ApplicationCommand

List of slash commands and descriptions

func (*Bot) UserPlaysSot

func (b *Bot) UserPlaysSot(s *discordgo.Session, m *discordgo.PresenceUpdate)

UserPlaysSot monitors the presence updates of the guild users. If a user starts playing SoT, it will fetch the current balance from the SoT API and store it in the database. Once the user finished their game, it will redo the same action and present a difference to the announce channel

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL