chat

package
v0.0.0-...-7dafa0e Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Separator = " \u2014 "
)

Variables

View Source
var (
	Whats = []string{"What?", "Nani?", "Huh?", "なんてこったい?", "Que?"}
)

Functions

func DeleteBotMessages

func DeleteBotMessages(s *discordgo.Session, channelID, aroundID string)

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 RandomString(s []string) string

func SendEmbedMessage

func SendEmbedMessage(s *discordgo.Session, channelId string, title string, description string, fields map[string]string, color int) *discordgo.Message

func SendErrorEmbedMessage

func SendErrorEmbedMessage(s *discordgo.Session, channelId string, title string, err error) *discordgo.Message

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 SendRawEmbedMessage(s *discordgo.Session, channelId string, e *discordgo.MessageEmbed) *discordgo.Message

func SendSimpleEmbedMessage

func SendSimpleEmbedMessage(s *discordgo.Session, channelId string, title string, description string) *discordgo.Message

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 SendWarningEmbedMessage(s *discordgo.Session, channelId, title, warning string) *discordgo.Message

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

func SliceToMessageString(slice []string) (str string)

Types

type MessageBuilder

type MessageBuilder struct {
	strings.Builder
	// contains filtered or unexported fields
}

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

Jump to

Keyboard shortcuts

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