gamer

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package gamer provides Discord Game status generation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gamer

type Gamer interface {
	Game() *dg.Game
}

Gamer is a closure that generates a Discord Game status.

type Queue

type Queue []Gamer

Queue provides a pseudo-random queue of Gamers.

func (Queue) Cycle

func (q Queue) Cycle(ctx context.Context, ses *dg.Session)

Cycle continually updates status on the session.

func (Queue) Random

func (q Queue) Random() Gamer

Random calls Select on an index in [0, (len(q) + 1) / 2).

func (Queue) Select

func (q Queue) Select(i int) Gamer

Select returns the Gamer at position i in the Queue, updating the order accordingly.

type Static

type Static dg.Game

Static is a Gamer that returns itself.

func (*Static) Game

func (s *Static) Game() *dg.Game

Game implements Gamer.

type Uptime

type Uptime time.Time

Uptime is a Gamer that shows the duration since its value.

func (Uptime) Game

func (u Uptime) Game() *dg.Game

Game implements Gamer.

Jump to

Keyboard shortcuts

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