rogue

package
v0.0.0-...-739d34d Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasPermissionInChannel

func HasPermissionInChannel(s *discordgo.Session, permission int64, guildID, channelID, userID string) (bool, error)

func HasPermissionInGuild

func HasPermissionInGuild(s *discordgo.Session, permission int64, guildID, userID string) (bool, error)

func PlaySoundOnVoiceChannel

func PlaySoundOnVoiceChannel(s *discordgo.Session, guildID, channelID string, oSound *opus.Sound)

func SimpleInteractionResponse

func SimpleInteractionResponse(s *discordgo.Session, i *discordgo.Interaction, msg string)

Types

type Bot

type Bot struct {
	// contains filtered or unexported fields
}

func New

func New(l *logrus.Logger, c *config.Config) *Bot

func (*Bot) RegisterSlashCommandPlugin

func (b *Bot) RegisterSlashCommandPlugin(p SlashCommandPlugin) error

func (*Bot) Run

func (b *Bot) Run() error

type DiscordService

type DiscordService struct {
	Session *discordgo.Session
	// contains filtered or unexported fields
}

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 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)

Jump to

Keyboard shortcuts

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