plugins

package
v0.0.0-...-dfd4915 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: GPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Dispatcher *ext.Dispatcher = ext.NewDispatcher(&ext.DispatcherOpts{

	Error: func(b *gotgbot.Bot, ctx *ext.Context, err error) ext.DispatcherAction {
		fmt.Println("an error occurred while handling update:", err.Error())
		return ext.DispatcherActionNoop
	},
	MaxRoutines: ext.DefaultMaxRoutines,
})
View Source
var (
	PrivacyText = `
This bot does not connect to any datbase and hence does not store any user data in any form.
`
)

Functions

func CbCommand

func CbCommand(bot *gotgbot.Bot, ctx *ext.Context) error

CbCommand handles callback from command buttons.

func CbOpen

func CbOpen(bot *gotgbot.Bot, ctx *ext.Context) error

CbOpen handles callbacks from open_ buttons in search results.

func CommandHandler

func CommandHandler(bot *gotgbot.Bot, ctx *ext.Context) error

CommandHandler handles any command except start.

func Contains

func Contains(l []string, v string) bool

Checks if a string slice Contains an item.

func CreateJWPoster

func CreateJWPoster(backdropURL, posterURL, id string) *bytes.Buffer

Creates a poster image with a backdrop and poster as overlay.

func GetIMDbTitle

func GetIMDbTitle(id string) (gotgbot.InputMediaPhoto, [][]gotgbot.InlineKeyboardButton, error)

Gets an imdb title by it's id and returns an InputPhoto to be used.

func GetJWTitle

func GetJWTitle(id string) (gotgbot.InputMediaPhoto, [][]gotgbot.InlineKeyboardButton, error)

Gets a justwatch title by id and build the message that should be sent or edited.

func GetOMDbTitle

func GetOMDbTitle(id string) (gotgbot.InputMediaPhoto, [][]gotgbot.InlineKeyboardButton, error)

Gets an imdb title by it's id and returns an InputPhoto to be used.

func IMDbCommand

func IMDbCommand(bot *gotgbot.Bot, ctx *ext.Context) error

IMDbCommand handles the /imdb command.

func IMDbInlineSearch

func IMDbInlineSearch(query string) []gotgbot.InlineQueryResult

ImdbInlineSearch searches for query on imdb and returns results to be used in inline queries.

func InlineQueryHandler

func InlineQueryHandler(bot *gotgbot.Bot, ctx *ext.Context) error

Function that handles all inline queries.

func InlineResultHandler

func InlineResultHandler(bot *gotgbot.Bot, ctx *ext.Context) error

Edit message after the result is chosen.

func JWCommand

func JWCommand(bot *gotgbot.Bot, ctx *ext.Context) error

JWCommand handles the /justwatch or /jw command.

func JWInlineSearch

func JWInlineSearch(query string) []gotgbot.InlineQueryResult

JWInlineSearch searches for query on justwatch and returns results to be used in inline queries.

func OMDbInlineSearch

func OMDbInlineSearch(query string) []gotgbot.InlineQueryResult

OmdbInlineSearch searches for query on omdb and returns results to be used in inline queries.

func Start

func Start(bot *gotgbot.Bot, ctx *ext.Context) error

func UploadEnvssh

func UploadEnvssh(data *bytes.Buffer, id string) (string, error)

UploadEnvssh uploads photo/video to envs.sh. Media type should either be "video" or "photo". "Animation" is considered "video" here.

func UploadTelegraph

func UploadTelegraph(data *bytes.Buffer, mediaType string) (string, error)

https://github.com/StarkBotsIndustries/telegraph Upload photo/video to Telegra.ph on the '/upload' endpoint. Media type should either be "video" or "photo". "Animation" is considered "video" here.

Types

This section is empty.

Jump to

Keyboard shortcuts

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