bot

package
v0.0.0-...-f692fd6 Latest Latest
Warning

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

Go to latest
Published: May 5, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

type Bot struct {
	Prefix          string
	MoverBotToken   string
	MoverSession    *discordgo.Session
	PowerupTokens   []string
	DB              db.DataStorage
	PowerupSessions []*discordgo.Session
	Messages        *utils.Message
	Closing         chan int
}

Bot struct

func Init

func Init(configs config.ConfigurationParameters, messages *utils.Message, conn db.DataStorage) *Bot

Init creates the first bot object

func (*Bot) Close

func (bot *Bot) Close()

Close function ends the bot connection and closes its database

func (*Bot) GetGuildLocale

func (bot *Bot) GetGuildLocale(GuildID string) string

GetGuildLocale function will return the language for a guild, returning EN by default.

Input:

GuildID string : the ID of the guild

Output:

language string

func (*Bot) Move

func (bot *Bot) Move(m *discordgo.MessageCreate, params []string) (string, error)

Move function deals with the possible parameters for a move command

Inputs:

m *discordgo.MessageCreate : the message received by the bot
 params []string : all the parameters used in the message

Outputs:

	string : number of users moved by this command
 	error : a error if something wrong happened

func (*Bot) Start

func (bot *Bot) Start() error

Start function connects and ads the necessary handlers

func (*Bot) Summon

func (bot *Bot) Summon(m *discordgo.MessageCreate, params []string) (string, error)

Summon command moves all users to specified channel

Jump to

Keyboard shortcuts

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