discord

package
v0.0.0-...-ab9ee8d Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EmojiSuccess = Emoji("✅")
	EmojiError   = Emoji("❌")
	EmojiWarning = Emoji("⚠️")
	EmojiInfo    = Emoji("ℹ️")
)

status emojis

View Source
const (
	EmojiInventory  = Emoji("🎒")
	EmojiAlignment  = Emoji("⚖️")
	EmojiAbility    = Emoji("💪")
	EmojiPerk       = Emoji("➕")
	EmojiItem       = Emoji("📦")
	EmojiStatus     = Emoji("🔵")
	EmojiImmunity   = Emoji("🛡️")
	EmojiEffect     = Emoji("🌟")
	EmojiCoins      = Emoji("💰")
	EmojiCoinBonus  = Emoji("🔥")
	EmojiNote       = Emoji("📝")
	EmojiAnyAbility = Emoji("🔮")
	EmojiLimit      = Emoji("📏")
	EmojiDead       = Emoji("💀")
	EmojiAlive      = Emoji("👼")
	EmojiLuck       = Emoji("🍀")
	EmojiRoll       = Emoji("🎲")
	EmojiMail       = Emoji("📬")
)

inventory emojis

View Source
const (
	ColorThemeRed      = 0xff0000
	ColorThemeGreen    = 0x00ff00
	ColorThemeBlue     = 0x0000ff
	ColorThemeYellow   = 0xffff00
	ColorThemePurple   = 0xff00ff
	ColorThemeOrange   = 0xffa500
	ColorThemePink     = 0xffc0cb
	ColorThemeBlack    = 0x000000
	ColorThemeWhite    = 0xffffff
	ColorThemeGrey     = 0x808080
	ColorThemeBrown    = 0x8b4513
	ColorThemeGold     = 0xffd700
	ColorThemeSilver   = 0xc0c0c0
	ColorThemeBronze   = 0xcd7f32
	ColorThemeCopper   = 0xb87333
	ColorThemePlatinum = 0xe5e4e2
	ColorThemeDiamond  = 0x00ffff
	ColorThemeEmerald  = 0x50c878
	ColorThemeRuby     = 0xe0115f
	ColorThemeSapphire = 0x082567
	ColorThemeAmethyst = 0x9966cc
	ColorThemeTopaz    = 0xffc87c
	ColorThemePearl    = 0xfdeef4
	ColorThemeOpal     = 0x9fd8cb

	ColorItemCommon    = 0x00ff00
	ColorItemUncommon  = 0x0000ff
	ColorItemRare      = 0x00008b
	ColorItemEpic      = 0xff00ff
	ColorItemLegendary = 0xffc0cb
	ColorItemMythical  = 0x800080
	ColorItemUnique    = 0xffa500
)

Hex colors / color themes

View Source
const (
	McKusaID       = "206268866714796032"
	BetraylGuildID = "1096058997477490861"
)

ID of bot owner

View Source
const DebugCmd = ""

Temporary prefix for debugging commands.

Variables

View Source
var AdminRoles = []string{
	"Host",
	"Co-Host",
	"Bot Developer",
}

Current roles with eleveted permissions.

View Source
var ErrChannelNotFound = errors.New("channel not found")

Functions

func AddMemberToChannel

func AddMemberToChannel(s *discordgo.Session, channelID string, userID string) error

func AlexError

func AlexError(ctx ken.Context, title string) (err error)

func Bold

func Bold(s string) string

func BoolCommandArg

func BoolCommandArg(
	name string,
	description string,
	required bool,
) *discordgo.ApplicationCommandOption

func ChannelCommandArg

func ChannelCommandArg(required bool) *discordgo.ApplicationCommandOption

Require an option called "channel" within the command.

func Code

func Code(s string) string

func ComponentColorByRarity

func ComponentColorByRarity(rarity string) int

func CreateChannelWithinCategory

func CreateChannelWithinCategory(s *discordgo.Session, e *discordgo.InteractionCreate, categoryName string, channelName string, hidden ...bool) (*discordgo.Channel, error)

func CreateHiddenChannel

func CreateHiddenChannel(s *discordgo.Session, e *discordgo.InteractionCreate, channelName string, whitelistIds ...string) (*discordgo.Channel, error)

Wrapper ontop of discordgo.GuildChannelCreate to create a hidden channel besided for the user and the admin

func ErrorMessage

func ErrorMessage(ctx ken.Context, title string, message string) (err error)

Send Pre-Formatted Error Message after slash command

func GetAdminRoleUsers

func GetAdminRoleUsers(s *discordgo.Session, e *discordgo.InteractionCreate, adminRoles ...string) []string

func GetChannelMembers

func GetChannelMembers(s *discordgo.Session, e *discordgo.InteractionCreate, channelID string) ([]*discordgo.Member, error)

func GetGuildChannelCategory

func GetGuildChannelCategory(s *discordgo.Session, e *discordgo.InteractionCreate, channelName string) (*discordgo.Channel, error)

func GetMembersWithRole

func GetMembersWithRole(s *discordgo.Session, e *discordgo.InteractionCreate, roleID string) []*discordgo.Member

Get all the players within a guild that have the specified role

func GetMembersWithRoleName

func GetMembersWithRoleName(s *discordgo.Session, e *discordgo.InteractionCreate, roleName string) []*discordgo.Member

func Indent

func Indent(s string) string

func IntCommandArg

func IntCommandArg(
	name string,
	description string,
	required bool,
) *discordgo.ApplicationCommandOption

func IsAdminRole

func IsAdminRole(ctx ken.Context, adminRoles ...string) bool

Check if user who invoked command has required role

func Italic

func Italic(s string) string

func MentionChannel

func MentionChannel(channelID string) string

func MentionUser

func MentionUser(userID string) string

func NotAdminError

func NotAdminError(ctx ken.Context) (err error)

Returns

func NotConfessionalError

func NotConfessionalError(ctx ken.Context, channelID string) (err error)

func SilentSuccessfulMessage

func SilentSuccessfulMessage(ctx ken.Context,
	title string,
	message string,
) (err error)

func SilentWarningMessage

func SilentWarningMessage(ctx ken.Context,
	title string,
	message string,
) (err error)

func Strike

func Strike(s string) string

func StringCommandArg

func StringCommandArg(
	name string,
	description string,
	required bool,
) *discordgo.ApplicationCommandOption

func SuccessfulMessage

func SuccessfulMessage(ctx ken.Context,
	title string,
	message string,
) (err error)

Send Pre-Formatted Successful Message after slash command

func Underline

func Underline(s string) string

func UpdatePinnedMessage

func UpdatePinnedMessage(
	ctx ken.Context,
	channelID string,
	messageID string,
	content string,
) (*discordgo.Message, error)

func UserCommandArg

func UserCommandArg(required bool) *discordgo.ApplicationCommandOption

Require an option called "user" within the command.

func WarningMessage

func WarningMessage(ctx ken.Context,
	title string,
	message string,
) (err error)

Types

type Emoji

type Emoji string

func (Emoji) String

func (e Emoji) String() string

String implements fmt.Stringer.

type KenComponent

type KenComponent struct {
	// How the button will look and be interacted with
	Button discordgo.MessageComponent
	// Actual logic for the button
	Handler func(ctx ken.ComponentContext) bool
}

Wrapped for handling creation of components with ken

func NewKenComponent

func NewKenComponent(
	btn discordgo.Button,
	handler func(ctx ken.ComponentContext) bool,
) *KenComponent

I'm not sure whats going on and at this point I'm too afraid to ask

Jump to

Keyboard shortcuts

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