Documentation

Botan
in package

Class Botan

Integration with http://botan.io statistics service for Telegram bots

Table of Contents

$command  : string
The actual command that is going to be reported
$api_base_uri  : string
Botan.io API URL
$token  : string
Yandex AppMetrica application key
$client  : Client
Guzzle Client object
initializeBotan()  : mixed
Initialize Botan
lock()  : mixed
Lock function to make sure only the first command is reported (the one user requested)
shortenUrl()  : string
Url Shortener function
track()  : bool|string
Track function

Properties

$command

The actual command that is going to be reported

public static string $command = ''

Set as public to let the developers either:

  • block tracking from inside commands by setting the value to non-existent command
  • override which command is tracked when commands call other commands with executeCommand()

$api_base_uri

Botan.io API URL

protected static string $api_base_uri = 'https://api.botan.io'

$token

Yandex AppMetrica application key

protected static string $token = ''

$client

Guzzle Client object

private static Client $client

Methods

initializeBotan()

Initialize Botan

public static initializeBotan(string $token[, array<string|int, mixed> $options = [] ]) : mixed
Parameters
$token : string
$options : array<string|int, mixed> = []
Tags
throws
TelegramException
Return values
mixed

lock()

Lock function to make sure only the first command is reported (the one user requested)

public static lock([string $command = '' ]) : mixed

This is in case commands are calling other commands with executeCommand()

Parameters
$command : string = ''
Return values
mixed

shortenUrl()

Url Shortener function

public static shortenUrl(string $url, int $user_id) : string
Parameters
$url : string
$user_id : int
Tags
throws
TelegramException
Return values
string

track()

Track function

public static track(Update $update[, string $command = '' ]) : bool|string
Parameters
$update : Update
$command : string = ''
Tags
throws
TelegramException
Return values
bool|string

Search results