globals

package
v0.0.0-...-ce17089 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MsgError   = "Something went wrong."
	MsgHelpFmt = "%s - _%s_"
)

Variables

View Source
var (
	CommitID string
	Config   *myconfig.Config[MyConfig]
)

Functions

func FormatCommand

func FormatCommand(command, guildID string) string

func FormatVideo

func FormatVideo(v *rabbitpipe.Video) string

func GetPrefix

func GetPrefix(guildID string) string

func GetVoiceChannelID

func GetVoiceChannelID(s *discordgo.Session, m *discordgo.MessageCreate) (response string, g *discordgo.Guild, voiceChannelID string)

func ParseUserMessage

func ParseUserMessage(messageContent, guildID string) (command string, args []string, ok bool)

func SetPrefix

func SetPrefix(guildID, prefixValue string) string

Types

type BotCommand

type BotCommand struct {
	Handler   func([]string, *discordgo.Session, *discordgo.MessageCreate) string
	ShortCode string
	Help      string
}

func (BotCommand) FormatHelp

func (bc BotCommand) FormatHelp(command, guildID string) string

type KeyValuePair

type KeyValuePair struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type MyConfig

type MyConfig struct {
	ApplicationID string `json:"applicationId"`
	Token         string `json:"token"`
	Instance      string `json:"instance"`

	Prefixes []KeyValuePair `json:"prefixes"`
	Outros   []KeyValuePair `json:"outros"`
	Radios   []KeyValuePair `json:"radios"`

	MagazineSize uint `json:"magazineSize"`
}

Jump to

Keyboard shortcuts

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