chat

package
v0.0.0-...-4c1801a Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 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 DeleteInteractionResponse

func DeleteInteractionResponse(s *discordgo.Session, i *discordgo.InteractionCreate)

DeleteInteractionResponse deletes a response sent from an interaction

func DeleteReceivedMessage

func DeleteReceivedMessage(s *discordgo.Session, m *discordgo.MessageCreate)

DeleteReceivedMessage takes a created message and deletes it if it is not private

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 NewMessageCommandRouteHandler

func NewMessageCommandRouteHandler(s *discordgo.Session, cmds []*MessageCommand) func(*discordgo.Session, *discordgo.MessageCreate)

NewMessageCommandRouteHandler is a generic handler function that calls a corresponding command function by name

func NewSlashCommandRouteHandler

func NewSlashCommandRouteHandler(s *discordgo.Session, cmds []*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) *discordgo.Message

func SendErrorEmbedMessage

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

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, 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 SendMessageResponseForAction

func SendMessageResponseForAction(s *discordgo.Session, channelID, title, payload string, fields map[string]string, err error)

SendMessageResponseForAction sends a response for a message command

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 SendSimpleMessageResponseForAction

func SendSimpleMessageResponseForAction(s *discordgo.Session, channelID, title, payload string, err error)

SendSimpleMessageResponseForAction sends a response for a message command with no fields

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 MessageCommand

type MessageCommand struct {
	Command  string
	Function func(*discordgo.Session, *discordgo.MessageCreate)
}

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