controllers

package
v0.0.0-...-90919ac Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ApplicationVersion defines the running version
	ApplicationVersion string

	// BuildDate date where the application was built
	BuildDate string
)

Functions

func About

About returns information about tiger

func LatestDeaths

func LatestDeaths(context *Context, s *discordgo.Session, m *discordgo.MessageCreate) (*discordgo.MessageEmbed, error)

LatestDeaths retrieves the server latest deaths

func ServerStatus

func ServerStatus(context *Context, s *discordgo.Session, m *discordgo.MessageCreate) (*discordgo.MessageEmbed, error)

ServerStatus retrieves the current server status

func Uptime

Uptime returns the current bot uptime

func Version

Version returns the current running version

func ViewMonster

func ViewMonster(context *Context, s *discordgo.Session, m *discordgo.MessageCreate) (*discordgo.MessageEmbed, error)

ViewMonster returns information about the given monster

func ViewMonsterKilledPlayers

func ViewMonsterKilledPlayers(context *Context, s *discordgo.Session, m *discordgo.MessageCreate) (*discordgo.MessageEmbed, error)

ViewMonsterKilledPlayers returns the list of victims od the given monster

func ViewMonsterLoot

func ViewMonsterLoot(context *Context, s *discordgo.Session, m *discordgo.MessageCreate) (*discordgo.MessageEmbed, error)

ViewMonsterLoot returns the list of items a monster can give

func ViewPlayer

ViewPlayer views the given server character

func ViewPlayerDeaths

func ViewPlayerDeaths(context *Context, s *discordgo.Session, m *discordgo.MessageCreate) (*discordgo.MessageEmbed, error)

ViewPlayerDeaths retrieves the last deaths of the given player

func ViewSpell

ViewSpell returns information about the given spell

func ViewTopPlayersExperience

func ViewTopPlayersExperience(context *Context, s *discordgo.Session, m *discordgo.MessageCreate) (*discordgo.MessageEmbed, error)

ViewTopPlayersExperience returns a list of the server top experience players

func ViewTopPlayersMagicLevel

func ViewTopPlayersMagicLevel(context *Context, s *discordgo.Session, m *discordgo.MessageCreate) (*discordgo.MessageEmbed, error)

ViewTopPlayersMagicLevel returns a list of the server top magic level players

func ViewTopPlayersSkillAxe

func ViewTopPlayersSkillAxe(context *Context, s *discordgo.Session, m *discordgo.MessageCreate) (*discordgo.MessageEmbed, error)

ViewTopPlayersSkillAxe returns a list of the server top skill axe players

func ViewTopPlayersSkillClub

func ViewTopPlayersSkillClub(context *Context, s *discordgo.Session, m *discordgo.MessageCreate) (*discordgo.MessageEmbed, error)

ViewTopPlayersSkillClub returns a list of the server top skill club players

func ViewTopPlayersSkillDist

func ViewTopPlayersSkillDist(context *Context, s *discordgo.Session, m *discordgo.MessageCreate) (*discordgo.MessageEmbed, error)

ViewTopPlayersSkillDist returns a list of the server top skill dist players

func ViewTopPlayersSkillFishing

func ViewTopPlayersSkillFishing(context *Context, s *discordgo.Session, m *discordgo.MessageCreate) (*discordgo.MessageEmbed, error)

ViewTopPlayersSkillFishing returns a list of the server top skill fishing players

func ViewTopPlayersSkillFist

func ViewTopPlayersSkillFist(context *Context, s *discordgo.Session, m *discordgo.MessageCreate) (*discordgo.MessageEmbed, error)

ViewTopPlayersSkillFist returns a list of the server top skill fist players

func ViewTopPlayersSkillShielding

func ViewTopPlayersSkillShielding(context *Context, s *discordgo.Session, m *discordgo.MessageCreate) (*discordgo.MessageEmbed, error)

ViewTopPlayersSkillShielding returns a list of the server top skill shielding players

func ViewTopPlayersSkillSword

func ViewTopPlayersSkillSword(context *Context, s *discordgo.Session, m *discordgo.MessageCreate) (*discordgo.MessageEmbed, error)

ViewTopPlayersSkillSword returns a list of the server top skill sword players

func ViewVocation

func ViewVocation(context *Context, s *discordgo.Session, m *discordgo.MessageCreate) (*discordgo.MessageEmbed, error)

ViewVocation sends information about the given vocation

Types

type Command

type Command struct {
	Usage       string
	Description string
	Options     []CommandOption
}

Command defines a discord command

func (*Command) RenderUsage

func (c *Command) RenderUsage(title string, ctx *Context, s *discordgo.Session, m *discordgo.MessageCreate) (*discordgo.MessageEmbed, error)

RenderUsage sends a message with the command usage

type CommandOption

type CommandOption struct {
	Name        string
	Usage       string
	Description string
}

CommandOption defines a command option value

type Context

type Context struct {
	Start                    time.Time
	Config                   *config.Config
	Monsters                 map[string]*xml.Monster
	Vocations                map[string]*xml.Vocation
	Items                    map[int]xml.Item
	InstantSpells            map[string]*xml.InstantSpell
	InstantSpellsFuzzySearch *closestmatch.ClosestMatch
	RuneSpells               map[string]*xml.RuneSpell
	RuneSpellsFuzzySearch    *closestmatch.ClosestMatch
	ConjureSpells            map[string]*xml.ConjureSpell
	ConjureSpellsFuzzySearch *closestmatch.ClosestMatch
	DB                       *sql.DB
	Template                 map[string]*xml.CommandTemplate
	Cache                    *cache.Cache
}

Context main controller for all actions

func (*Context) ExecuteTemplate

func (c *Context) ExecuteTemplate(name string, data map[string]interface{}) (*discordgo.MessageEmbed, error)

ExecuteTemplate executes the given markdown template file

type MonsterLoot

type MonsterLoot struct {
	Item   string
	Chance float64
}

MonsterLoot defines a list of monster loot

Jump to

Keyboard shortcuts

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