reminders

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RestartQueue

func RestartQueue()

RestartQueue instructs the queue to restart

func ScheduleQueue

func ScheduleQueue(session *discordgo.Session, onTrigger func(reminder *Reminder))

ScheduleQueue starts the queue that triggers the reminders

Types

type Reminder

type Reminder struct {
	ID        primitive.ObjectID `bson:"_id,omitempty"`
	Exceeds   int64              `bson:"exceeds"`
	UserID    string             `bson:"userID"`
	ChannelID string             `bson:"channelID"`
	Message   string             `bson:"message"`
}

Reminder represents a reminder

func Create

func Create(userID, channelID string, duration time.Duration, message string) (*Reminder, error)

Create creates a new reminder

func Get

func Get(userID string, n int64) (*Reminder, error)

Get returns the reminder of the given user which exceeds the n'th

func GetAll

func GetAll(userID string) ([]Reminder, error)

GetAll returns all reminders of the given user

func Next

func Next() (*Reminder, error)

Next returns the reminder which exceeds next

func (*Reminder) Delete

func (reminder *Reminder) Delete() error

Delete deletes the current reminder

Jump to

Keyboard shortcuts

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