discord

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2022 License: MIT Imports: 3 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Discord

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

Discord struct holds necessary data to communicate with the Discord API.

func New

func New() *Discord

New returns a new instance of a Discord notification service.

func (*Discord) AddReceivers

func (d *Discord) AddReceivers(channelIDs ...string)

AddReceivers takes Discord channel IDs and adds them to the internal channel ID list. The Send method will send a given message to all those channels.

func (*Discord) AuthenticateWithBotToken added in v0.2.0

func (d *Discord) AuthenticateWithBotToken(token string) error

AuthenticateWithBotToken authenticates you as a bot to Discord via the given access token. For more info, see here: https://pkg.go.dev/github.com/bwmarrin/discordgo@v0.22.1#New

func (*Discord) AuthenticateWithOAuth2Token added in v0.2.0

func (d *Discord) AuthenticateWithOAuth2Token(token string) error

AuthenticateWithOAuth2Token authenticates you to Discord via the given OAUTH2 token. For more info, see here: https://pkg.go.dev/github.com/bwmarrin/discordgo@v0.22.1#New

func (Discord) Send

func (d Discord) Send(ctx context.Context, subject, message string) error

Send takes a message subject and a message body and sends them to all previously set chats.

Jump to

Keyboard shortcuts

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