utils

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Log      *slog.Logger
	LogLevel *slog.LevelVar
)

Functions

func FileToSlice

func FileToSlice(inputFile string) []string

func GetCdnUri

func GetCdnUri(fileName string) string

func GetNickFromInteraction

func GetNickFromInteraction(i *discordgo.InteractionCreate) string

Gets the nickname for the user that invoked the interaction in a guild if set, if not set or invoked in a direct message you get the username.

func GetOptionsStringsFromInteraction added in v0.3.5

func GetOptionsStringsFromInteraction(i *discordgo.InteractionCreate) map[string]string

func GetUsernameFromInteraction

func GetUsernameFromInteraction(i *discordgo.InteractionCreate) string

Gets the actual Discord username for the user that invoked an interaction, don't use this when you want want a nickname instead.

func GetUserobjectFromInteraction added in v0.3.5

func GetUserobjectFromInteraction(i *discordgo.InteractionCreate) *discordgo.User

func HexToDec added in v0.3.1

func HexToDec(hex string) int

func LogCmd added in v0.3.5

func LogCmd(i *discordgo.InteractionCreate)

func RandomMemberName added in v0.4.1

func RandomMemberName(members []*discordgo.Member) string

func ReturnInteractionMessageUrl

func ReturnInteractionMessageUrl(i *discordgo.InteractionCreate) string

Types

type CustomizationOptions

type CustomizationOptions struct {
	BotName     string `json:"BotName"`
	RootCommand string `json:"RootCommand"`
	DocsURL     string `json:"DocsURL"`
	CDN         struct {
		BaseURL string
		Files   map[string]string
	}
}

func GetCustoms added in v0.3.3

func GetCustoms() CustomizationOptions

Jump to

Keyboard shortcuts

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