discord

package
v0.0.0-...-f3179c4 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

type Session struct {
	S         *discordgo.Session
	Config    types.Config
	UserIndex map[string]discordgo.Member
}

Session wraps the discordgo session and provides some additional features

func New

func New(s *discordgo.Session, c types.Config) (d *Session)

New creates a new wrapped discord session

func (*Session) ChannelFileSend

func (s *Session) ChannelFileSend(channelID string, name string, r io.Reader)

ChannelFileSend is a wrapper in case we need to block haram things in the future

func (*Session) ChannelMessageSend

func (s *Session) ChannelMessageSend(channelID string, content string)

ChannelMessageSend filters out everyone and here mentions

func (*Session) ChannelMessageSendEmbed

func (s *Session) ChannelMessageSendEmbed(channelID string, content *discordgo.MessageEmbed)

ChannelMessageSendEmbed filters out everyone and here mentions

func (*Session) GetCurrentChannelMessageFrequency

func (s *Session) GetCurrentChannelMessageFrequency(channelID string) (freq float64, err error)

GetCurrentChannelMessageFrequency returns messages-per-second

func (*Session) GetRandomChannel

func (s *Session) GetRandomChannel() (channel string, err error)

func (*Session) GetUserFromName

func (s *Session) GetUserFromName(name string) (user discordgo.Member, exists bool)

GetUserFromName returns a discordgo.Member from a discord username

Jump to

Keyboard shortcuts

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