handler

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApplicationCommandChat string = "chat"
)
View Source
const (
	MaxMessageLength int = 2000
)

Variables

This section is empty.

Functions

func IsWordDivider added in v0.2.5

func IsWordDivider(r rune) bool

IsWordDivider returns true if the rune is a word divider.(Currently only space is considered a word divider)

func SendMessageByChunk

func SendMessageByChunk(message string, maxChunkLength int, send chan<- string)

Types

type DiscordHandler

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

func NewDiscordHandler

func NewDiscordHandler(chatGPT provider.ChatGPTService) *DiscordHandler

func (*DiscordHandler) GetInteractionCreateHandler

func (h *DiscordHandler) GetInteractionCreateHandler() func(s *discordgo.Session, i *discordgo.InteractionCreate)

func (*DiscordHandler) GetMessageCreateHandler

func (h *DiscordHandler) GetMessageCreateHandler() func(s *discordgo.Session, m *discordgo.MessageCreate)

GetMessageCreateHandler This function will be called (due to AddHandler above) every time a new message is created on any channel that the authenticated bot has access to.

It is called whenever a message is created but only when it's sent through a server as we did not request IntentsDirectMessages.

Jump to

Keyboard shortcuts

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