discord

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEvent

func NewEvent(guildEvent *discordgo.GuildScheduledEvent) *core.Event

NewEvent converts a discordgo.GuildScheduledEvent to birdbot event

func NewUser

func NewUser(user *discordgo.User) *core.User

NewUser creates a new user object from a discordgo.User object

Types

type Discord

type Discord struct {
	mock.Mock
	// contains filtered or unexported fields
}

func New

func New(guildID string, token string) *Discord

New creates a new Discord session

func (*Discord) ArchiveChannel

func (discord *Discord) ArchiveChannel(channel *core.Channel) error

ArchiveChannel archives a channel

func (*Discord) DeleteChannel

func (discord *Discord) DeleteChannel(channel *core.Channel) (bool, error)

DeleteChannel deletes a channel

func (*Discord) GetVerifiedChannel

func (discord *Discord) GetVerifiedChannel(channel *core.Channel) *core.Channel

GetVerifiedChannel looks up channel data and returns a verified objec

func (*Discord) MoveChannelToCategory

func (discord *Discord) MoveChannelToCategory(channel *core.Channel, categoryID string) error

MoveChannelToCategory places a channel in a given category

func (*Discord) NewChannelFromID

func (discord *Discord) NewChannelFromID(ID string) *core.Channel

NewChannelFromID creates a channel from a given ID

func (*Discord) NewChannelFromName

func (discord *Discord) NewChannelFromName(channel_name string) (*core.Channel, error)

NewChannelFromName creates a channel object with its name

func (*Discord) OnEventCreate

func (discord *Discord) OnEventCreate(handler func(*Discord, *core.Event))

OnEventCreate registers a handler when a guild scheduled event is created

func (*Discord) OnEventDelete

func (discord *Discord) OnEventDelete(handler func(*Discord, *core.Event))

OnEventDelete registers a handler when a guild scheduled event is deleted

func (*Discord) OnEventUpdate

func (discord *Discord) OnEventUpdate(handler func(*Discord, *core.Event))

OnEventUpdate registers a handler when a guild scheduled event is updated

func (*Discord) OnReady

func (discord *Discord) OnReady(handler func(*Discord))

OnReady registers a handler for when the Discord session is ready

func (*Discord) Run

func (discord *Discord) Run() error

Run opens the Discod session until exit

func (*Discord) SendMessage

func (discord *Discord) SendMessage(channel *core.Channel, message string) error

SendMessage sends a message to a given channel

func (*Discord) Stop

func (discord *Discord) Stop()

Stop tells the Discord session to exit

Jump to

Keyboard shortcuts

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