components

package
v0.0.0-...-99e36ab Latest Latest
Warning

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

Go to latest
Published: May 14, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package components contains all static and support variables for iris.

Index

Constants

View Source
const (
	InvitePermission = 0x1 |
		0x10 |
		0x20 |
		0x40 |
		0x400 |
		0x800 |
		0x2000 |
		0x4000 |
		0x8000 |
		0x10000 |
		0x20000 |
		0x40000 |
		0x4000000 |
		0x8000000 |
		0x10000000 |
		0x20000000 |
		0x40000000 // manage emoji

	Intents = discordgo.IntentsDirectMessages |
		discordgo.IntentsGuildBans |
		discordgo.IntentsGuildEmojis |
		discordgo.IntentsGuildIntegrations |
		discordgo.IntentsGuildInvites |
		discordgo.IntentsGuildMembers |
		discordgo.IntentsGuildMessageReactions |
		discordgo.IntentsGuildMessages |
		discordgo.IntentsGuildPresences |
		discordgo.IntentsGuildVoiceStates |
		discordgo.IntentsGuilds

	EmbedColorError    = 0xd32f2f
	EmbedColorDefault  = 0xffc107
	EmbedColorUpdated  = 0x8bc34a
	EmbedColorGray     = 0xb0bec5
	EmbedColorOrange   = 0xfb8c00
	EmbedColorGreen    = 0x8BC34A
	EmbedColorCyan     = 0x00BCD4
	EmbedColorYellow   = 0xFFC107
	EmbedColorViolet   = 0x6A1B9A
	ReportRevokedColor = 0x9C27B0
)
View Source
const (
	BaseAuthURLTemplate string = "https://discord.com/api/oauth2/authorize?client_id=%s&scope=bot&permissions=%d"
)

Variables

View Source
var (
	AppVersion = "TEST_BUILD"
	AppCommit  = "TEST_BUILD"
	AppDate    = "0"
	Release    = "FALSE"
	Repo       = "https://github.com/Iridaceae/iridaceae"

	StatsStartupTime      = time.Now()
	StatsCommandsExecuted = 0
	StatsMessageAnalyzed  = 0

	ErrSessionNotDefined = errors.New("session not defined")
	ErrEmbedNotDefined   = errors.New("embed not defined")

	PermLvlBotOwner   = 69420
	PermLvlGuildOwner = 100
)

Functions

func GetInviteLink(s *discordgo.Session) string

GetInviteLink returns bot invite link with correct permissions.

func IsRelease

func IsRelease() bool

IsRelease will check if given build tag is Release.

Types

type EmbedMessage

type EmbedMessage struct {
	*discordgo.Message
	// contains filtered or unexported fields
}

EmbedMessage wraps discordgo.Message with some more features.

func SendEmbed

func SendEmbed(s *discordgo.Session, channelID, content, title string, color int) *EmbedMessage

SendEmbed creates a discordgo.MessageEmbed afrom passed content, title, and color then send it to specific channel. If no color is specified, then use EmbedColorViolet.

func SendEmbedComplexRaw

func SendEmbedComplexRaw(s *discordgo.Session, embed *discordgo.MessageEmbed, channelID, mention string) *EmbedMessage

SendEmbedComplexRaw takes given mentions and embed then streamline to given channel, returns correspondingly EmbedMessage instance with internal error.

func SendEmbedError

func SendEmbedError(s *discordgo.Session, channelID string, err error) *EmbedMessage

SendEmbedError will send given error to user about a specific command errors.

func SendEmbedRaw

func SendEmbedRaw(s *discordgo.Session, channelID string, embed *discordgo.MessageEmbed) *EmbedMessage

SendEmbedRaw passed embed to a channel and set occurred error to internal errors.

func (*EmbedMessage) DeleteAfter

func (e *EmbedMessage) DeleteAfter(d time.Duration) *EmbedMessage

DeleteAfter deletes message after a specified duration when the message still exists and returned sets error to EmbedMessage.

func (*EmbedMessage) Edit

func (e *EmbedMessage) Edit(content, title string, color int) *EmbedMessage

Edit updates given embed message with given content replace internal message and error of the embed instance.

func (*EmbedMessage) EditRaw

func (e *EmbedMessage) EditRaw(embed *discordgo.MessageEmbed) *EmbedMessage

EditRaw updates current embed message with given raw embed then replace internal message and error of this embed instance.

func (*EmbedMessage) Error

func (e *EmbedMessage) Error() error

Error returns embed error.

func (*EmbedMessage) SendEmbedComplex

func (e *EmbedMessage) SendEmbedComplex(s *discordgo.Session, channelID, content, title string) *EmbedMessage

SendEmbedComplex sends a embed message with user mentions that allows to notify users about certain tasks.

Jump to

Keyboard shortcuts

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