msgcol

package
v0.0.0-...-9bc5058 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CollectionManager

type CollectionManager struct {
	Collectors map[string][]*MessageCollector
}

CollectionManager is a mediator for message collectors.

func GetCollectionManager

func GetCollectionManager() *CollectionManager

GetCollectionManager returns CollectionManager instance.

func (*CollectionManager) CancelCollector

func (colMnger *CollectionManager) CancelCollector(channelID string, id uint16) error

CancelCollector cancels a message collector.

func (*CollectionManager) Dispatch

func (colMnger *CollectionManager) Dispatch(msg *discordgo.Message)

Dispatch dispatches a message to the appropriate collectors.

func (*CollectionManager) NewCollector

func (colMnger *CollectionManager) NewCollector(channelID string, sleepTime time.Duration, amnt int) *MessageCollector

NewCollector collects messages in the designated channel for the supplied amount of time.

type MessageCollector

type MessageCollector struct {
	ID        uint16
	ChannelID string
	Msgs      chan *discordgo.Message
}

MessageCollector collects messages.

Jump to

Keyboard shortcuts

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