Documentation ¶
Index ¶
- func HasPermissionInChannel(s *discordgo.Session, permission int64, guildID, channelID, userID string) (bool, error)
- func HasPermissionInGuild(s *discordgo.Session, permission int64, guildID, userID string) (bool, error)
- func PlaySoundOnVoiceChannel(s *discordgo.Session, guildID, channelID string, oSound *opus.Sound)
- func SimpleInteractionResponse(s *discordgo.Session, i *discordgo.Interaction, msg string)
- type Bot
- type DiscordService
- type SlashCommand
- type SlashCommandDataOptions
- type SlashCommandPlugin
- type SlashSubCommandManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasPermissionInChannel ¶
func HasPermissionInGuild ¶
func PlaySoundOnVoiceChannel ¶
func SimpleInteractionResponse ¶
func SimpleInteractionResponse(s *discordgo.Session, i *discordgo.Interaction, msg string)
Types ¶
type Bot ¶
type Bot struct {
// contains filtered or unexported fields
}
func (*Bot) RegisterSlashCommandPlugin ¶
func (b *Bot) RegisterSlashCommandPlugin(p SlashCommandPlugin) error
type DiscordService ¶
func NewDiscordService ¶
func NewDiscordService(l *logrus.Logger, config *config.Config) *DiscordService
func (*DiscordService) Open ¶
func (ds *DiscordService) Open() (<-chan *discordgo.InteractionCreate, error)
type SlashCommand ¶
type SlashCommand *discordgo.ApplicationCommand
type SlashCommandDataOptions ¶
type SlashCommandDataOptions map[string]*discordgo.ApplicationCommandInteractionDataOption
type SlashCommandPlugin ¶
type SlashCommandPlugin interface { // here you setup the plugin's state and add handlers for each subcommand Initalize() error // bot will send the InteractionCreate event to this method HandleSlashCommand(s *discordgo.Session, i *discordgo.Interaction, commandPath string, options SlashCommandDataOptions) // value of this will be used to register the slash command with the Discord API SlashCommand() SlashCommand }
type SlashSubCommandManager ¶
type SlashSubCommandManager struct {
// contains filtered or unexported fields
}
func NewSlashSubCommandManager ¶
func NewSlashSubCommandManager(l *logrus.Logger) *SlashSubCommandManager
func (*SlashSubCommandManager) AddHandler ¶
func (scm *SlashSubCommandManager) AddHandler(commandPath string, fn func(s *discordgo.Session, i *discordgo.Interaction, options SlashCommandDataOptions))
func (*SlashSubCommandManager) CallHandler ¶
func (scm *SlashSubCommandManager) CallHandler(s *discordgo.Session, i *discordgo.Interaction, commandPath string, options SlashCommandDataOptions)
Click to show internal directories.
Click to hide internal directories.