bot

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

func HandleHelpCommand added in v0.1.1

func HandleHelpCommand(c tele.Context) error

Types

type BotConfig added in v0.1.1

type BotConfig struct {
	// Telegram bot token
	TelegramBotToken string `env:"TELEGRAM_BOT_TOKEN" required:"true"`

	// OpenAI API key
	OpenAIAPIKey string `env:"OPENAI_API_KEY" required:"true"`

	// whitelist (chat ID)
	BotWhitelist []int64 `env:"BOT_WHITELIST"`

	// enable the /image command
	EnableImageCommand bool `env:"ENABLE_IMAGE_COMMAND"`
}

type ChatGPTService added in v0.1.1

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

func NewChatGPTService added in v0.1.1

func NewChatGPTService(key string) *ChatGPTService

func (*ChatGPTService) HandleENCommand added in v0.1.8

func (g *ChatGPTService) HandleENCommand(c tele.Context) error

func (*ChatGPTService) HandleJPCommand added in v0.1.8

func (g *ChatGPTService) HandleJPCommand(c tele.Context) error

func (*ChatGPTService) HandleNewChat added in v0.1.1

func (g *ChatGPTService) HandleNewChat(c tele.Context) error

func (*ChatGPTService) HandlePolishCommand added in v0.3.0

func (g *ChatGPTService) HandlePolishCommand(c tele.Context) error

func (*ChatGPTService) HandleResetCommand added in v0.1.8

func (g *ChatGPTService) HandleResetCommand(c tele.Context) error

func (*ChatGPTService) HandleSetCommand added in v0.1.1

func (g *ChatGPTService) HandleSetCommand(c tele.Context) error

func (*ChatGPTService) HandleTCCommand added in v0.1.1

func (g *ChatGPTService) HandleTCCommand(c tele.Context) error

func (*ChatGPTService) HandleTextReply added in v0.1.1

func (g *ChatGPTService) HandleTextReply(c tele.Context) error

type ImageService added in v0.1.1

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

func NewImageService added in v0.1.1

func NewImageService(key string) *ImageService

func (*ImageService) HandleImageCommand added in v0.1.1

func (s *ImageService) HandleImageCommand(c tele.Context) error

Jump to

Keyboard shortcuts

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