debounce

package
v0.0.0-...-5c9ae66 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTimestampFor

func NewTimestampFor(t time.Time) string

NewTimestampFor t in the format understood by the debounce package

func OnTimestamp

func OnTimestamp(lastTimestamp string, debounce time.Duration) (bool, time.Duration)

OnTimestamp returns true if lastTimestamp is not past the debounce duration to now

Types

type Interaction

type Interaction func(i *discordgo.InteractionCreate) (bool, time.Duration)

Interaction debouncer function

func InteractionTimestamp

func InteractionTimestamp(getTimestamp extract.MessageString, debounce time.Duration) Interaction

InteractionTimestamp debounces on the timestamp extracted using getTimestamp

Jump to

Keyboard shortcuts

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