menu

package
v0.0.0-...-1928642 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDutchText

func GetDutchText(item CategoryDay) (itemName string, itemDescription string, err error)

func GetEnglishText

func GetEnglishText(item CategoryDay) (itemName string, itemDescription string, err error)

func GetItemText

func GetItemText(item CategoryDay, language string) (itemName string, itemDescription string, err error)

GetItemText returns the item strings with the correct language attempts to retrieve the requested info TODO: is it possible to pass a list of languages and their responses to generalize this function?

func GetSiteContent

func GetSiteContent(campus string) []interface{}

GetSiteContent returns the json from the api

Types

type ById

type ById []CategoryDay

func (ById) Len

func (d ById) Len() int

func (ById) Less

func (d ById) Less(i, j int) bool

func (ById) Swap

func (d ById) Swap(i, j int)

type CategoryDay

type CategoryDay struct {
	ShortDescriptionNL string
	ShortDescriptionEN string
	Category           struct {
		ID     string
		NameNL string
		NameEN string
	}
	ChoiceGroups []interface{}
}
type MenuCommand struct{}

func NewMenuCommand

func NewMenuCommand() *MenuCommand
func (h *MenuCommand) Info() []command.Command

Info return the commands in this package

func (h *MenuCommand) InstallSlashCommands(session *discordgo.Session) error

InstallSlashCommands registers the slash commands

func (h *MenuCommand) Register(registry command.Registry, server command.Server)

Register registers the handlers

SayMenu relays the menu

type ResponseTexts

type ResponseTexts struct {
	Language         string
	LanguageCode     string
	TryLater         string
	NoWeekMenu       string
	NoWeekMenuSunday string
	NoDayMenu        string
	PoliteResponse   string
	NoItem           func(itemName string) string
}

func GetResponseTexts

func GetResponseTexts(language string) (responses ResponseTexts)

GetResponseTexts returns the different localisation options

type WeekMenu

type WeekMenu struct {
	Days [5]struct {
		MenuItems []CategoryDay
		Date      time.Time
	}
}

only works for Geel... not anymore!

Jump to

Keyboard shortcuts

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