internal

package
v0.0.0-...-e985f82 Latest Latest
Warning

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

Go to latest
Published: May 26, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MSG_START_FMT          = "Hi %s! This is the Unciv Notification Bot!"
	MSG_ERR_NOT_FOUND      = "Sorry, I couldn't find that command. Please try something else."
	MSG_ERR_UNEXPECTED_FMT = "An unexpected error has occurred. Please try again later.\n\nError reference: %s" // error reference
	MSG_ERR_NO_GAME_FOUND  = "Did not find any games bound to this chat. Use the /bind command with your game's ID to bind a game to this chat."
)
View Source
const (
	MSG_TURN_FMT              = "It is your turn! (as of %s)"
	MSG_TURN_REGISTERED_FMT   = "[%s](tg://user?id=%d): " + MSG_TURN_FMT
	MSG_TURN_UNREGISTERED_FMT = "%s: " + MSG_TURN_FMT
)
View Source
const (
	MSG_ERR_BIND_NO_ARGS    = "Syntax: /bind <game ID>"
	MSG_ERR_CONNECT_NO_ARGS = "Syntax: /register <unciv ID>"
)

Variables

This section is empty.

Functions

func CommandBind

func CommandBind(bot *telegrambot.Bot, update tgbotapi.Update) error

func CommandConnect

func CommandConnect(bot *telegrambot.Bot, update tgbotapi.Update) error

func CommandNotFound

func CommandNotFound(bot *telegrambot.Bot, update tgbotapi.Update) error

func CommandStart

func CommandStart(bot *telegrambot.Bot, update tgbotapi.Update) error

func CommandTurn

func CommandTurn(bot *telegrambot.Bot, update tgbotapi.Update) error

Types

type BotContext

type BotContext struct {
	Database db.Database
}

BotContext is used to store additional information in the bot object

func GetBotContext

func GetBotContext(bot *telegrambot.Bot) *BotContext

func NewBotContext

func NewBotContext(bot *telegrambot.Bot) *BotContext

func (*BotContext) InitialiseMemoryDB

func (context *BotContext) InitialiseMemoryDB() (err error)

func (*BotContext) InitialiseSQLiteDB

func (context *BotContext) InitialiseSQLiteDB(path string) (err error)

Jump to

Keyboard shortcuts

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