transmitter

package
v0.0.0-...-56bbfdb Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package transmitter provides functionality for transmitting arbitrary webhook messages on Discord.

Existing webhooks are used for messages sent, and if necessary, new webhooks are created to ensure messages in multiple popular channels don't cause messages to be registered as new users.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Transmitter

type Transmitter struct {
	// contains filtered or unexported fields
}

A Transmitter represents a message manager instance for a single guild.

func New

func New(session *discordgo.Session, guild string, prefix string, limit int) (*Transmitter, error)

New returns a new Transmitter given a Discord session, guild ID, and webhook prefix.

func (*Transmitter) Close

func (t *Transmitter) Close() error

Close immediately stops all active webhook timers and deletes webhooks.

func (*Transmitter) GetID

func (t *Transmitter) GetID() string

func (*Transmitter) Message

func (t *Transmitter) Message(channel string, username string, avatarURL string, content string) (err error)

Message transmits a message to the given channel with the given username, avatarURL, and content.

Note that this function will wait until Discord responds with an answer.

Jump to

Keyboard shortcuts

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