Documentation ¶
Index ¶
- Constants
- Variables
- func DeleteBotMessages(s *discordgo.Session, channelID, aroundID string)
- func EditInteractionResponse(s *discordgo.Session, i *discordgo.InteractionCreate, content string)
- func GetRawAboutEmbedMessage(s *discordgo.Session) *discordgo.MessageEmbed
- func NewSlashCommandRouteHandler(s *discordgo.Session, cmds map[string]*SlashCommand) func(*discordgo.Session, *discordgo.InteractionCreate)
- func RandomString(s []string) string
- func SendEmbedMessage(s *discordgo.Session, channelId string, title string, description string, ...) *discordgo.Message
- func SendErrorEmbedMessage(s *discordgo.Session, channelId string, title string, err error) *discordgo.Message
- func SendErrorInteractionEmbedForAction(s *discordgo.Session, i *discordgo.InteractionCreate, title string, err error)
- func SendInteractionAckForAction(s *discordgo.Session, i *discordgo.InteractionCreate, err error)
- func SendInteractionEmbedForAction(s *discordgo.Session, i *discordgo.InteractionCreate, ...)
- func SendInteractionRawEmbedForAction(s *discordgo.Session, i *discordgo.InteractionCreate, ...)
- func SendInteractionRawEmbedsForAction(s *discordgo.Session, i *discordgo.InteractionCreate, ...)
- func SendInteractionResponseForAction(s *discordgo.Session, i *discordgo.InteractionCreate, payload string, ...)
- func SendRawEmbedMessage(s *discordgo.Session, channelId string, e *discordgo.MessageEmbed) *discordgo.Message
- func SendSimpleEmbedMessage(s *discordgo.Session, channelId string, title string, description string) *discordgo.Message
- func SendSimpleInteractionEmbedForAction(s *discordgo.Session, i *discordgo.InteractionCreate, ...)
- func SendSimpleInteractionEmbedsForAction(s *discordgo.Session, i *discordgo.InteractionCreate, title string, ...)
- func SendWarningEmbedMessage(s *discordgo.Session, channelId, title, warning string) *discordgo.Message
- func SendWarningInteractionEmbedForAction(s *discordgo.Session, i *discordgo.InteractionCreate, ...)
- func SliceToMessageString(slice []string) (str string)
- type MessageBuilder
- type SlashCommand
Constants ¶
const (
Separator = " \u2014 "
)
Variables ¶
var (
Whats = []string{"What?", "Nani?", "Huh?", "なんてこったい?", "Que?"}
)
Functions ¶
func DeleteBotMessages ¶
DeleteBotMessages deletes all bot messages found in the given channel
func EditInteractionResponse ¶
func EditInteractionResponse(s *discordgo.Session, i *discordgo.InteractionCreate, content string)
EditInteractionResponse edits the original response of an interaction
func GetRawAboutEmbedMessage ¶
func GetRawAboutEmbedMessage(s *discordgo.Session) *discordgo.MessageEmbed
func NewSlashCommandRouteHandler ¶
func NewSlashCommandRouteHandler(s *discordgo.Session, cmds map[string]*SlashCommand) func(*discordgo.Session, *discordgo.InteractionCreate)
NewSlashCommandRouteHandler is a generic handler function that calls a corresponding command function by name for slash commands
func RandomString ¶
func SendEmbedMessage ¶
func SendErrorEmbedMessage ¶
func SendErrorInteractionEmbedForAction ¶
func SendErrorInteractionEmbedForAction(s *discordgo.Session, i *discordgo.InteractionCreate, title string, err error)
SendErrorInteractionEmbedForAction sends an error embed response for an interaction
func SendInteractionAckForAction ¶
func SendInteractionAckForAction(s *discordgo.Session, i *discordgo.InteractionCreate, err error)
SendInteractionAckForAction sends a deferred interaction acknowledgment for an action
func SendInteractionEmbedForAction ¶
func SendInteractionEmbedForAction(s *discordgo.Session, i *discordgo.InteractionCreate, title, description string, fields map[string]string, color int, err error)
SendInteractionEmbedForAction sends an embed response to an interaction
func SendInteractionRawEmbedForAction ¶
func SendInteractionRawEmbedForAction(s *discordgo.Session, i *discordgo.InteractionCreate, embed *discordgo.MessageEmbed, err error)
SendInteractionRawEmbedForAction sends a raw embed response to an interaction
func SendInteractionRawEmbedsForAction ¶
func SendInteractionRawEmbedsForAction(s *discordgo.Session, i *discordgo.InteractionCreate, embeds []*discordgo.MessageEmbed, err error)
SendInteractionRawEmbedsForAction sends a raw embed response to an interaction
func SendInteractionResponseForAction ¶
func SendInteractionResponseForAction(s *discordgo.Session, i *discordgo.InteractionCreate, payload string, err error)
SendInteractionResponseForAction sends a response to an interaction
func SendRawEmbedMessage ¶
func SendSimpleEmbedMessage ¶
func SendSimpleInteractionEmbedForAction ¶
func SendSimpleInteractionEmbedForAction(s *discordgo.Session, i *discordgo.InteractionCreate, title, description string, err error)
SendSimpleInteractionEmbedForAction sends an embed response for an interaction with no fields
func SendSimpleInteractionEmbedsForAction ¶
func SendSimpleInteractionEmbedsForAction(s *discordgo.Session, i *discordgo.InteractionCreate, title string, descriptions []string, err error)
SendSimpleInteractionEmbedsForAction sends multiple embed responses for an interaction
func SendWarningEmbedMessage ¶
func SendWarningInteractionEmbedForAction ¶
func SendWarningInteractionEmbedForAction(s *discordgo.Session, i *discordgo.InteractionCreate, title, description string, err error)
SendWarningInteractionEmbedForAction sends a warning embed response for an interaction with no fields
func SliceToMessageString ¶
Types ¶
type MessageBuilder ¶
func NewMessageBuilder ¶
func NewMessageBuilder() *MessageBuilder
func (*MessageBuilder) GetMessageStrings ¶
func (b *MessageBuilder) GetMessageStrings() []string
func (*MessageBuilder) Reset ¶
func (b *MessageBuilder) Reset()
func (*MessageBuilder) Write ¶
func (b *MessageBuilder) Write(s string) error
type SlashCommand ¶
type SlashCommand struct { Command *discordgo.ApplicationCommand Function func(*discordgo.Session, *discordgo.InteractionCreate) }