pabot

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2023 License: GPL-3.0 Imports: 19 Imported by: 3

Documentation

Index

Constants

View Source
const (
	PrizarenaBotStartCommandListTournaments = "list"
	PrizarenaBotStartCommandNewTournament   = "new"
)

Variables

View Source
var GetPrizarenaApiClient func(c context.Context) prizarena_interfaces.ApiClient
View Source
var OnStartTournament = botsfw.Command{
	Code: onStartTournamentCode,
	Action: func(whc botsfw.WebhookContext) (m botsfw.MessageFromBot, err error) {
		return
	},
}
View Source
var TournamentsCommandCode = "tournaments"

Functions

func GetLangButtons

func GetLangButtons(command, currentLang string) (row []tgbotapi.InlineKeyboardButton)

func GetQueryValueFromUrl

func GetQueryValueFromUrl(inlineQueryText, paramName string) (v string, err error)

func GetUrlValues

func GetUrlValues(s string) (values url.Values, err error)

func InitPrizarenaInGameBot

func InitPrizarenaInGameBot(prizarenaGameID, prizarenaToken string, router botsfw.WebhooksRouter)

func ListTournamentsTelegramInlineButton

func ListTournamentsTelegramInlineButton(t strongo.SingleLocaleTranslator, prizarenaGameID string) []tgbotapi.InlineKeyboardButton

func NewCachedApi

func NewCachedApi(c context.Context, prizarenaGameID, prizarenaToken string) pacached.Cached

func NewTournamentTelegramInlineButton

func NewTournamentTelegramInlineButton(t strongo.SingleLocaleTranslator, prizarenaGameID string) []tgbotapi.InlineKeyboardButton
func OnStartIfTournamentLink(whc botsfw.WebhookContext, prizarenaGameID, prizarenaToken string) (m botsfw.MessageFromBot, err error)

func ProcessInlineQueryTournament

func ProcessInlineQueryTournament(whc botsfw.WebhookContext, inlineQuery InlineQueryContext, prizarenaGameID, prizarenaToken, tournamentParamName string, reply InlineQueryMessageBuilder) (m botsfw.MessageFromBot, err error)

func RenderTournamentCard

func RenderTournamentCard(c context.Context, cardMode TournamentCardMode, tournament pamodels.Tournament) (m botsfw.MessageFromBot, err error)

Types

type InlineQueryContext

type InlineQueryContext struct {
	ID   string
	Text string
}

type InlineQueryMessageBuilder

type InlineQueryMessageBuilder func(tournament pamodels.Tournament) (m botsfw.MessageFromBot, err error)

type TournamentCardMode

type TournamentCardMode int
const (
	TournamentCardModeNewMessage TournamentCardMode = iota
	TournamentCardModeEditCallbackMessage
	TournamentCardModeInlineQuery
)

Jump to

Keyboard shortcuts

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