events

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CancelSchedule

func CancelSchedule(e *Event)

func ChoiceButtonHandler

func ChoiceButtonHandler(s *discordgo.Session, i *discordgo.InteractionCreate)

func EventWatcher

func EventWatcher()

func ResetSchedule

func ResetSchedule(e *Event)

func Setup

func Setup(b *bot.Bot) error

func TemplateExists

func TemplateExists(name string) (bool, error)

Types

type CommsTier

type CommsTier int
const (
	Relaxed CommsTier = iota // no comm restrictions
	One                      // max PTT restrictions
	Two                      // mid PTT restrictions
	Three                    // low PTT restrictions
)

type Event

type Event struct {
	Id         string                         `json:"id" bson:"_id"`
	StartTime  time.Time                      `json:"start_time" bson:"start_time"`
	EndTime    time.Time                      `json:"end_time" bson:"end_time"`
	Repeat     Repeat                         `json:"repeat" bson:"repeat"`
	Attendees  []*users.User                  `json:"attendees" bson:"attendees"`
	Status     status.Status                  `json:"status" bson:"status"`
	GuildEvent *discordgo.GuildScheduledEvent `json:"guild_event" bson:"guild_event"`
	MessageId  string                         `json:"message_id" bson:"message_id"`
	PTU        bool                           `json:"ptu" bson:"ptu"`

	// also in template
	Name        string      `json:"name" bson:"name"`
	AutoStart   bool        `json:"auto_start" bson:"auto_start"`
	Description string      `json:"description" bson:"description"`
	Cover       string      `json:"cover" bson:"cover"`
	Positions   []*Position `json:"positions" bson:"positions"`
	CommsTier   CommsTier   `json:"comms_tier" bson:"comms_tier"`
	// contains filtered or unexported fields
}

func Get

func Get(id string) (*Event, error)

func GetAll

func GetAll() ([]*Event, error)

func GetAllWithFilter

func GetAllWithFilter(filter interface{}) ([]*Event, error)

func GetByMessageId

func GetByMessageId(messageId string) (*Event, error)

func (*Event) AllPositionsFilled

func (e *Event) AllPositionsFilled() bool

func (*Event) Delete

func (e *Event) Delete() error

func (*Event) Exists

func (e *Event) Exists() bool

func (*Event) GetButtons

func (e *Event) GetButtons() ([]discordgo.MessageComponent, error)

func (*Event) GetEmbeds

func (e *Event) GetEmbeds() (*discordgo.MessageEmbed, error)

func (*Event) Lock

func (e *Event) Lock()

func (*Event) NotifyOfEvent

func (e *Event) NotifyOfEvent() error

func (*Event) Save

func (e *Event) Save() error

func (*Event) SetStatus

func (e *Event) SetStatus(s status.Status) error

func (*Event) Unlock

func (e *Event) Unlock()

func (*Event) UpdateMessage

func (e *Event) UpdateMessage() error

type Position

type Position struct {
	Id       string     `json:"_id" bson:"_id"`
	Name     string     `json:"name" bson:"name"`
	Max      int32      `json:"max" bson:"max"`
	MinRank  ranks.Rank `json:"min_rank" bson:"min_rank"`
	Members  []string   `json:"members" bson:"members"`
	Emoji    string     `json:"emoji" bson:"emoji"`
	Order    int        `json:"order" bson:"order"`
	FillLast bool       `json:"fill_last" bson:"fill_last"`
}

type Repeat

type Repeat int
const (
	None Repeat = iota
	Daily
	Weekly
	Monthly
)

type Template

type Template struct {
	Id          string      `json:"id" bson:"_id"`
	Name        string      `json:"name" bson:"name"`
	AutoStart   bool        `json:"auto_start" bson:"auto_start"`
	Description string      `json:"description" bson:"description"`
	Cover       string      `json:"cover" bson:"cover"`
	Positions   []*Position `json:"positions" bson:"positions"`
	CommsTier   CommsTier   `json:"comms_tier" bson:"comms_tier"`
}

func GetAllTemplates

func GetAllTemplates() ([]*Template, error)

func (*Template) Delete

func (t *Template) Delete() error

func (*Template) Save

func (t *Template) Save() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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