command

package
v0.0.0-...-f80fce7 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2020 License: LGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const AddGameCmd = "addgame"

AddGameCmd - constant indicating the string the command should be

View Source
const DeopCmd = "deop"

DeopCmd - constant indicating the string the command should be

View Source
const DisableCmd = "disable"

DisableCmd - constant indicating the string the command should be

View Source
const EnableCmd = "enable"

EnableCmd - constant indicating the string the command should be

View Source
const GamesCmd = "games"

GamesCmd - constant indicating the string the command should be

View Source
const HelpCmd = "help"

HelpCmd - constant indicating the string the command should be

View Source
const InspireCmd = "inspire"

InspireCmd - constant indicating the string the command should be

View Source
const LaughCmd = "laugh"

LaughCmd - constant indicating the string the command should be

View Source
const OpCmd = "op"

OpCmd - constant indicating the string the command should be

View Source
const PlayCmd = "play"

PlayCmd - constant indicating the string the command should be

View Source
const PollCmd = "poll"

PollCmd - constant indicating the string the command should be

View Source
const RegCmd = "reg"

RegCmd - constant indicating the string the command should be

View Source
const SourceCmd = "source"

SourceCmd - constant indicating the string the command should be

View Source
const SummonCmd = "summon"

SummonCmd - constant indicating the string the command should be

View Source
const WhoIsCmd = "whois"

WhoIsCmd - constant indicating the string the command should be

Variables

View Source
var PermissionList = map[string]database.UserRole{
	AddGameCmd: database.MEMBER,
	DeopCmd:    database.ADMIN,
	DisableCmd: database.OFFICER,
	GamesCmd:   database.MEMBER,
	EnableCmd:  database.OFFICER,
	HelpCmd:    database.INACTIVE,
	InspireCmd: database.REGISTERED,
	LaughCmd:   database.REGISTERED,
	OpCmd:      database.ADMIN,
	PlayCmd:    database.REGISTERED,
	PollCmd:    database.REGISTERED,
	RegCmd:     database.OFFICER,
	SourceCmd:  database.INACTIVE,
	WhoIsCmd:   database.MEMBER,
	SummonCmd:  database.MEMBER,
}

PermissionList - Permissions for individual commands acts as a "must have AT LEAST" this role, meaning anyone with a higher role will be able to use it.

View Source
var ProgrammedCommands = map[string]bool{
	AddGameCmd: true,
	DeopCmd:    true,
	DisableCmd: true,
	GamesCmd:   true,
	EnableCmd:  true,
	HelpCmd:    true,
	InspireCmd: true,
	LaughCmd:   true,
	OpCmd:      true,
	PlayCmd:    true,
	PollCmd:    true,
	RegCmd:     true,
	SourceCmd:  true,
	WhoIsCmd:   true,
	SummonCmd:  true,
}

ProgrammedCommands - commands for lookup whether a string is a valid command or not

Functions

This section is empty.

Types

type Response

type Response struct {
	ShouldRespondToUser    bool
	ShouldRespondToChannel bool
	ShouldSendVoice        bool

	VoiceOutput *dca.EncodeSession

	Message        string
	ReactionsToAdd []string
}

Response - struct indicating what the bot should do after a command is executed

func AddGame

func AddGame(discordID, gameName string, maxPlayers uint8) ([]Response, error)

AddGame - Register a game to the user that requested the !addgame command.

func Deop

func Deop(discordID string) ([]Response, error)

Deop - demote a player to MEMBER

func Disable

func Disable(discordID string) ([]Response, error)

Disable - remove a player's ability to use Tito.

func Enable

func Enable(discordID string) ([]Response, error)

Enable - allow a player to use the Tito.

func Games

func Games(players uint8) ([]Response, error)

Games - list the games that can be played by the number passed, considering player count

func Help

func Help(discordID string) ([]Response, error)

Help - display tito's commands

func Inspire

func Inspire() ([]Response, error)

Inspire - unembedded inspire, play from an external resource (TBD)

func Laugh

func Laugh() ([]Response, error)

Laugh - play a crazy ohjousama laugh

func Op

func Op(discordID string) ([]Response, error)

Op - op a player, unlocking various advanced administrative features.

func Play

func Play(uri string) ([]Response, error)

Play - play the indicated youtube url through Tito.

func Poll

func Poll(options []string) ([]Response, error)

Poll - start a poll for the indicated options.

func Reg

func Reg(discordID, realname string) ([]Response, error)

Reg - register the user with Tito for advanced features (really all it is it records the real name) so whois works.

func Source

func Source() ([]Response, error)

Source - give the URL for the repository for Tito :)

func Summon

func Summon(mentionTag string) ([]Response, error)

Summon - mentions (@<user>) three times.

func WhoIs

func WhoIs(discordID string) ([]Response, error)

WhoIs - show the indicated user's real name.

Jump to

Keyboard shortcuts

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