bot

package
v0.0.0-...-8d6a1ef Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const InlineResponseText = "<b>%s</b> - <i>%s, %s</i>\n\nID: <b>%s</b>\nTrace: %v"

InlineResponseText is the template for inline queries replies (chosen server). Params: 1: Server sponsor 2: Server name 3: Server country 4: Server ID 5: Server trace

View Source
const StartCommandReply = "Hi <b>%s</b>! 👋\n" +
	"You can invoke me in any chat you want, providing the name of the Speedtest server you're interested to.\n\n" +
	"Example:\n" +
	"<pre>@speedtestidbot Vodafone</pre>\n\n" +
	"Then, you just have to select an item from the list, and you'll get ID and other useful data back.\n\n" +
	"This bot is licensed under <a href=\"https://www.gnu.org/licenses/gpl-3.0.html\">GNU GPLv3</a>.\n" +
	"Source code can be found <a href=\"https://github.com/theedoran/speedtestidbot\">here</a>."

StartCommandReply is the template for /start command. Params: 1. user first name

Variables

This section is empty.

Functions

func HandleInlineQuery

func HandleInlineQuery(bot *tgbotapi.BotAPI, inline *tgbotapi.InlineQuery)

HandleInlineQuery handles user query (search), forwarding text to SearchByName (Speedtest API). It displays server info and an inline keyboard containing an URL button to test with the chosen server in the browser.

func HandleStartCommand

func HandleStartCommand(bot *tgbotapi.BotAPI, message *tgbotapi.Message)

HandleStartCommand handles /start in chats.

func LogRequest

func LogRequest(update interface{})

LogRequest prints information regarding incoming update. Only with env var DEBUG set to true.

func Start

func Start(done <-chan os.Signal)

Start starts the Telegram bot.

Types

This section is empty.

Jump to

Keyboard shortcuts

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