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 ¶
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.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.