registerdb

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CharacterName

func CharacterName(discordID string) string

CharacterName returns the name of a discord ID

func New

func New(config *config.API) error

New instantiates a new registerdb

func Set

func Set(discordID string, discordName string, characterName string, channelID string, messageID string, status string, timeout int64)

Set updates or adds an entry for a specified register id

func Update

func Update(discordID string, status string, timeout int64) error

Update sets a new timeout and status to a registration entry

Types

type RegisterDatabase

type RegisterDatabase struct {
	Registrations map[string]RegisterEntry `toml:"registrations"`
}

RegisterDatabase wraps registrations

type RegisterEntry

type RegisterEntry struct {
	DiscordID     string
	DiscordName   string
	Status        string
	CharacterName string
	ChannelID     string
	MessageID     string
	Timeout       int64
	Code          string
}

RegisterEntry is a registration request entry

func Entry

func Entry(discordID string) (RegisterEntry, error)

Entry returns an existing entry

func FindByCode

func FindByCode(code string) (entry RegisterEntry, err error)

FindByCode returns an entry if code matches and is valid

func QueuedEntries

func QueuedEntries() (entries []RegisterEntry, err error)

QueuedEntries returns a list of items that need to be relayed in EQ

Jump to

Keyboard shortcuts

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