discord

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//ActionMessage means discord sent the message
	ActionMessage = "message"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Discord

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

Discord represents a discord connection

func New

func New(ctx context.Context, config config.Discord) (*Discord, error)

New creates a new discord connect

func (*Discord) Connect

func (t *Discord) Connect(ctx context.Context) error

Connect establishes a new connection with Discord

func (*Discord) Disconnect

func (t *Discord) Disconnect(ctx context.Context) error

Disconnect stops a previously started connection with Discord. If called while a connection is not active, returns nil

func (*Discord) EditMessage added in v1.0.2

func (t *Discord) EditMessage(channelID string, messageID string, message string) error

EditMessage lets you edit a previously sent message

func (*Discord) GetIGNName added in v1.0.2

func (t *Discord) GetIGNName(s *discordgo.Session, serverID string, userid string) string

GetIGNName returns an IGN: tagged name from discord if applicable

func (*Discord) IsConnected

func (t *Discord) IsConnected() bool

IsConnected returns if a connection is established

func (*Discord) LastSentMessage added in v1.0.2

func (t *Discord) LastSentMessage() (channelID string, messageID string, err error)

LastSentMessage returns the channelID and message ID of last message sent

func (*Discord) Send

func (t *Discord) Send(req request.DiscordSend) error

Send sends a message to discord

func (*Discord) SetChannelName added in v0.0.23

func (t *Discord) SetChannelName(channelID string, name string) error

SetChannelName is used for voice channel setting via SQLReport

func (*Discord) StatusUpdate added in v0.0.4

func (t *Discord) StatusUpdate(ctx context.Context, online int, customText string) error

StatusUpdate updates the status text on discord

func (*Discord) Subscribe

func (t *Discord) Subscribe(ctx context.Context, onMessage func(interface{}) error) error

Subscribe listens for new events on discord

Jump to

Keyboard shortcuts

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