Primer commit del sistema separado falta mejorar mucho

This commit is contained in:
nickpons666
2025-12-30 01:18:46 -06:00
commit 1679c73e52
2384 changed files with 472342 additions and 0 deletions

15
vendor/telegram-bot/api/.editorconfig vendored Executable file
View File

@@ -0,0 +1,15 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://editorconfig.org
root = true
[*]
charset = utf-8
indent_size = 4
indent_style = space
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false

51
vendor/telegram-bot/api/CHANGELOG.md vendored Executable file
View File

@@ -0,0 +1,51 @@
# Changelog
All Notable changes to `PHP Telegram Bot Api` will be documented in this file
## 2.5.0 - 2023-08-09
### Added
- Add missing `protect_content` and `allow_sending_without_reply` parameters to `\TelegramBot\Api\BotApi` methods
- Add support `attach://<file_attach_name>` in `\TelegramBot\Api\BotApi` methods `sendMediaGroup`, `createNewStickerSet`, `addStickerToSet`, `editMessageMedia`
- Rename `thumb` to `thumbnail` parameter in `Animation`, `Document`, `Sticker`, `StickerSet`, `Video`, `VideoNote` types
- Rename `thumb_*` to `thumbnail_*` parameter in `Inline/QueryResult` types
- Add missing phpDoc for `$replyMarkup` parameters
- Fix phpDoc for `\TelegramBot\Api\BotApi::setWebhook` `$allowedUpdates` parameter. Automatically serialize if array passed
- Fix phpDoc for `\TelegramBot\Api\Types\Message::$newChatMembers`
- Add `\TelegramBot\Api\BotApi::getChatMemberCount` method
- Add `\TelegramBot\Api\BotApi::banChatMember` method
- Add `$messageId` to `\TelegramBot\Api\BotApi::unpinChatMessage`
- Add `\TelegramBot\Api\Types\ForceReply::$inputFieldPlaceholder` property
### Deprecated
- Deprecate using `thumb*` methods in `\TelegramBot\Api\BotApi`
- Deprecate method `\TelegramBot\Api\BotApi::setStickerSetThumb`. Use `\TelegramBot\Api\BotApi::setStickerSetThumbnail` instead
- Deprecate `\TelegramBot\Api\Types\ReplyKeyboardHide` class
- Deprecate `\TelegramBot\Api\BotApi::getChatMembersCount`. Use `\TelegramBot\Api\BotApi::getChatMemberCount` instead
- Deprecate `\TelegramBot\Api\BotApi::kickChatMember`. Use `\TelegramBot\Api\BotApi::banChatMember` instead
## 2.4.0 - 2023-05-11
### Added
- Add `\TelegramBot\Api\Types\Venue` mapping (`foursquare_type`, `google_place_id`, `google_place_type`)
- Add `scope` and `languageCode` parameters to `\TelegramBot\Api\BotApi::setMyCommands`
- Add WebApp support: `\TelegramBot\Api\BotApi::answerWebAppQuery` method and `\TelegramBot\Api\Types\Message::$webAppData` property
- Add `\TelegramBot\Api\Types\ReplyKeyboardMarkup::$isPersistent` property
- Add `\TelegramBot\Api\Types\ReplyKeyboardMarkup::$inputFieldPlaceholder` property
### Fixed
- Fix `\TelegramBot\Api\Collection\Collection::addItem` max count constraint (#333)
- Fix `\TelegramBot\Api\Types\StickerSet` mapping
- Fix `\TelegramBot\Api\BotApi::copyMessage` not returning `\TelegramBot\Api\Types\MessageId`
- Fix new `$messageThreadId` parameter in `\TelegramBot\Api\BotApi` methods placed not in the end of the list of parameters
### Changed
- `\TelegramBot\Api\BotApi::getMyCommands` now returns instance `\TelegramBot\Api\Types\ArrayOfBotCommand` instead of `\TelegramBot\Api\Types\BotCommand` array
- `\TelegramBot\Api\BotApi::setMyCommands` now accepts instance of `\TelegramBot\Api\Types\ArrayOfBotCommand` instead of `\TelegramBot\Api\Types\BotCommand` array
### Deprecated
- Deprecate `\TelegramBot\Api\Botan` class
- Deprecate `$trackerToken` parameter in `\TelegramBot\Api\BotApi::__construct`
- Deprecate `$trackerToken` parameter in `\TelegramBot\Api\Events\EventCollection::__construct`
- Deprecate `\TelegramBot\Api\Types\PollAnswer::getFrom` use `\TelegramBot\Api\Types\PollAnswer::getUser` instead
- Deprecate passing array of BotCommand to `\TelegramBot\Api\BotApi::setMyCommands`. Use `\TelegramBot\Api\Types\ArrayOfBotCommand` instead

32
vendor/telegram-bot/api/CONTRIBUTING.md vendored Executable file
View File

@@ -0,0 +1,32 @@
# Contributing
Contributions are **welcome** and will be fully **credited**.
We accept contributions via Pull Requests on [Github](https://github.com/tgbot/api).
## Pull Requests
- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer).
- **Add tests!** - Your patch won't be accepted if it doesn't have tests.
- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.
- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.
- **Create feature branches** - Don't ask us to pull from your master branch.
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.
## Running Tests
``` bash
$ phpunit
```
**Happy coding**!

21
vendor/telegram-bot/api/LICENSE.md vendored Executable file
View File

@@ -0,0 +1,21 @@
# The MIT License (MIT)
Copyright (c) 2015 Ilya Gusev <mail@igusev.ru>
> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal
> in the Software without restriction, including without limitation the rights
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> copies of the Software, and to permit persons to whom the Software is
> furnished to do so, subject to the following conditions:
>
> The above copyright notice and this permission notice shall be included in
> all copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
> THE SOFTWARE.

174
vendor/telegram-bot/api/README.md vendored Executable file
View File

@@ -0,0 +1,174 @@
# PHP Telegram Bot Api
[![Latest Version on Packagist](https://img.shields.io/packagist/v/telegram-bot/api.svg?style=flat-square)](https://packagist.org/packages/telegram-bot/api)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
[![Total Downloads](https://img.shields.io/packagist/dt/telegram-bot/api.svg?style=flat-square)](https://packagist.org/packages/telegram-bot/api)
An extended native php wrapper for [Telegram Bot API](https://core.telegram.org/bots/api) without requirements. Supports all methods and types of responses.
## Bots: An introduction for developers
>Bots are special Telegram accounts designed to handle messages automatically. Users can interact with bots by sending them command messages in private or group chats.
>You control your bots using HTTPS requests to [bot API](https://core.telegram.org/bots/api).
>The Bot API is an HTTP-based interface created for developers keen on building bots for Telegram.
To learn how to create and set up a bot, please consult [Introduction to Bots](https://core.telegram.org/bots) and [Bot FAQ](https://core.telegram.org/bots/faq).
## Installation
Via Composer
``` bash
$ composer require telegram-bot/api
```
## Usage
See example [DevAnswerBot](https://github.com/TelegramBot/DevAnswerBot) (russian).
### API Wrapper
#### Send message
``` php
$bot = new \TelegramBot\Api\BotApi('YOUR_BOT_API_TOKEN');
$bot->sendMessage($chatId, $messageText);
```
#### Send document
```php
$bot = new \TelegramBot\Api\BotApi('YOUR_BOT_API_TOKEN');
$document = new \CURLFile('document.txt');
$bot->sendDocument($chatId, $document);
```
#### Send message with reply keyboard
```php
$bot = new \TelegramBot\Api\BotApi('YOUR_BOT_API_TOKEN');
$keyboard = new \TelegramBot\Api\Types\ReplyKeyboardMarkup(array(array("one", "two", "three")), true); // true for one-time keyboard
$bot->sendMessage($chatId, $messageText, null, false, null, $keyboard);
```
#### Send message with inline keyboard
```php
$bot = new \TelegramBot\Api\BotApi('YOUR_BOT_API_TOKEN');
$keyboard = new \TelegramBot\Api\Types\Inline\InlineKeyboardMarkup(
[
[
['text' => 'link', 'url' => 'https://core.telegram.org']
]
]
);
$bot->sendMessage($chatId, $messageText, null, false, null, $keyboard);
```
#### Send media group
```php
$bot = new \TelegramBot\Api\BotApi('YOUR_BOT_API_TOKEN');
$media = new \TelegramBot\Api\Types\InputMedia\ArrayOfInputMedia();
$media->addItem(new TelegramBot\Api\Types\InputMedia\InputMediaPhoto('https://avatars3.githubusercontent.com/u/9335727'));
$media->addItem(new TelegramBot\Api\Types\InputMedia\InputMediaPhoto('https://avatars3.githubusercontent.com/u/9335727'));
// Same for video
// $media->addItem(new TelegramBot\Api\Types\InputMedia\InputMediaVideo('http://clips.vorwaerts-gmbh.de/VfE_html5.mp4'));
$bot->sendMediaGroup($chatId, $media);
```
#### Client
```php
require_once "vendor/autoload.php";
try {
$bot = new \TelegramBot\Api\Client('YOUR_BOT_API_TOKEN');
// or initialize with botan.io tracker api key
// $bot = new \TelegramBot\Api\Client('YOUR_BOT_API_TOKEN', 'YOUR_BOTAN_TRACKER_API_KEY');
//Handle /ping command
$bot->command('ping', function ($message) use ($bot) {
$bot->sendMessage($message->getChat()->getId(), 'pong!');
});
//Handle text messages
$bot->on(function (\TelegramBot\Api\Types\Update $update) use ($bot) {
$message = $update->getMessage();
$id = $message->getChat()->getId();
$bot->sendMessage($id, 'Your message: ' . $message->getText());
}, function () {
return true;
});
$bot->run();
} catch (\TelegramBot\Api\Exception $e) {
$e->getMessage();
}
```
### Botan SDK (not supported more)
[Botan](http://botan.io) is a telegram bot analytics system based on [Yandex.Appmetrica](http://appmetrica.yandex.com/).
In this document you can find how to setup Yandex.Appmetrica account, as well as examples of Botan SDK usage.
### Creating an account
* Register at http://appmetrica.yandex.com/
* After registration you will be prompted to create Application. Please use @YourBotName as a name.
* Save an API key from settings page, you will use it as a token for Botan API calls.
* Download lib for your language, and use it as described below. Don`t forget to insert your token!
Since we are only getting started, you may discover that some existing reports in AppMetriсa aren't properly working for Telegram bots, like Geography, Gender, Age, Library, Devices, Traffic sources and Network sections. We will polish that later.
## SDK usage
#### Standalone
```php
$tracker = new \TelegramBot\Api\Botan('YOUR_BOTAN_TRACKER_API_KEY');
$tracker->track($message, $eventName);
```
#### API Wrapper
```php
$bot = new \TelegramBot\Api\BotApi('YOUR_BOT_API_TOKEN', 'YOUR_BOTAN_TRACKER_API_KEY');
$bot->track($message, $eventName);
```
You can use method 'getUpdates()'and all incoming messages will be automatically tracked as `Message`-event.
#### Client
```php
$bot = new \TelegramBot\Api\Client('YOUR_BOT_API_TOKEN', 'YOUR_BOTAN_TRACKER_API_KEY');
```
_All registered commands are automatically tracked as command name_
## Change log
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
## Testing
``` bash
$ composer test
```
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## Security
If you discover any security related issues, please email mail@igusev.ru instead of using the issue tracker.
## Credits
- [Ilya Gusev](https://github.com/iGusev)
- [All Contributors](../../contributors)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

52
vendor/telegram-bot/api/composer.json vendored Executable file
View File

@@ -0,0 +1,52 @@
{
"name": "telegram-bot/api",
"description": "PHP Wrapper for Telegram Bot API",
"keywords": [
"php",
"telegram",
"bot",
"bot api"
],
"homepage": "https://github.com/TelegramBot/Api",
"license": "MIT",
"authors": [
{
"name": "Ilya Gusev",
"email": "mail@igusev.ru",
"homepage": "https://php-cat.com",
"role": "Developer"
}
],
"require": {
"php" : ">=5.5.0",
"ext-curl": "*",
"ext-json": "*"
},
"require-dev": {
"symfony/phpunit-bridge" : "*",
"friendsofphp/php-cs-fixer": "^3.16",
"vimeo/psalm": "^5.9"
},
"autoload": {
"psr-4": {
"TelegramBot\\Api\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"TelegramBot\\Api\\Test\\": "tests"
}
},
"scripts": {
"test": "vendor/bin/simple-phpunit --colors=always",
"coverage": "XDEBUG_MODE=coverage vendor/bin/simple-phpunit --coverage-html build/coverage",
"psalm": "vendor/bin/psalm",
"cs-fix": "vendor/bin/php-cs-fixer fix --allow-risky=yes --diff --ansi",
"cs-check": "vendor/bin/php-cs-fixer fix --allow-risky=yes --diff --ansi --dry-run"
},
"extra": {
"branch-alias": {
"dev-master": "2.5-dev"
}
}
}

View File

@@ -0,0 +1,13 @@
<?php
namespace TelegramBot\Api;
/**
* Class BadMethodCallException
*
* @codeCoverageIgnore
* @package TelegramBot\Api
*/
class BadMethodCallException extends Exception
{
}

117
vendor/telegram-bot/api/src/BaseType.php vendored Executable file
View File

@@ -0,0 +1,117 @@
<?php
namespace TelegramBot\Api;
/**
* Class BaseType
* Base class for Telegram Types
*
* @package TelegramBot\Api
*/
abstract class BaseType
{
/**
* Array of required data params for type
*
* @var array
*/
protected static $requiredParams = [];
/**
* Map of input data
*
* @var array
*/
protected static $map = [];
/**
* Validate input data
*
* @param array $data
*
* @return bool
*
* @throws InvalidArgumentException
*/
public static function validate($data)
{
if (count(array_intersect_key(array_flip(static::$requiredParams), $data)) === count(static::$requiredParams)) {
return true;
}
throw new InvalidArgumentException();
}
/**
* @param array $data
* @return void
*/
public function map($data)
{
foreach (static::$map as $key => $item) {
if (isset($data[$key]) && (!is_array($data[$key]) || !empty($data[$key]))) {
$method = 'set' . self::toCamelCase($key);
if ($item === true) {
$this->$method($data[$key]);
} else {
$this->$method($item::fromResponse($data[$key]));
}
}
}
}
/**
* @param string $str
* @return string
*/
protected static function toCamelCase($str)
{
return str_replace(' ', '', ucwords(str_replace('_', ' ', $str)));
}
/**
* @param bool $inner
* @return array|string
*/
public function toJson($inner = false)
{
$output = [];
foreach (static::$map as $key => $item) {
$property = lcfirst(self::toCamelCase($key));
if (!is_null($this->$property)) {
if (is_array($this->$property)) {
$output[$key] = array_map(
/**
* @param mixed $v
* @return array|false|string
*/
function ($v) {
return is_object($v) ? $v->toJson(true) : $v;
},
$this->$property
);
} else {
$output[$key] = $item === true ? $this->$property : $this->$property->toJson(true);
}
}
}
return $inner === false ? json_encode($output) : $output;
}
/**
* @param array $data
* @return static
* @throws InvalidArgumentException
*/
public static function fromResponse($data)
{
self::validate($data);
/** @psalm-suppress UnsafeInstantiation */
$instance = new static();
$instance->map($data);
return $instance;
}
}

2807
vendor/telegram-bot/api/src/BotApi.php vendored Executable file

File diff suppressed because it is too large Load Diff

99
vendor/telegram-bot/api/src/Botan.php vendored Executable file
View File

@@ -0,0 +1,99 @@
<?php
namespace TelegramBot\Api;
use TelegramBot\Api\Types\Message;
/**
* @deprecated
* @psalm-suppress all
*/
class Botan
{
/**
* @var string Tracker url
*/
const BASE_URL = 'https://api.botan.io/track';
/**
* CURL object
*
* @var resource
*/
protected $curl;
/**
* Yandex AppMetrica application api_key
*
* @var string
*/
protected $token;
/**
* Botan constructor
*
* @param string $token
*
* @throws \Exception
*/
public function __construct($token)
{
if (!function_exists('curl_version')) {
throw new Exception('CURL not installed');
}
if (empty($token)) {
throw new InvalidArgumentException('Token should not be empty');
}
$this->token = $token;
$this->curl = curl_init();
}
/**
* Event tracking
*
* @param \TelegramBot\Api\Types\Message $message
* @param string $eventName
*
* @throws \TelegramBot\Api\Exception
* @throws \TelegramBot\Api\HttpException
*
* @return void
*/
public function track(Message $message, $eventName = 'Message')
{
$uid = $message->getFrom()->getId();
$options = [
CURLOPT_URL => self::BASE_URL . "?token={$this->token}&uid={$uid}&name={$eventName}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json'
],
CURLOPT_POSTFIELDS => $message->toJson(),
CURLOPT_TIMEOUT => 5,
];
curl_setopt_array($this->curl, $options);
/** @var string $response */
$response = curl_exec($this->curl);
/** @var array $result */
$result = BotApi::jsonValidate($response, true);
BotApi::curlValidate($this->curl);
if ($result['status'] !== 'accepted') {
throw new Exception('Error Processing Request');
}
}
/**
* Destructor. Close curl
*/
public function __destruct()
{
$this->curl && curl_close($this->curl);
}
}

490
vendor/telegram-bot/api/src/Client.php vendored Executable file
View File

@@ -0,0 +1,490 @@
<?php
namespace TelegramBot\Api;
use Closure;
use ReflectionFunction;
use TelegramBot\Api\Events\EventCollection;
use TelegramBot\Api\Types\Update;
use TelegramBot\Api\Types\Message;
use TelegramBot\Api\Types\Inline\InlineKeyboardMarkup;
use TelegramBot\Api\Types\ReplyKeyboardRemove;
use TelegramBot\Api\Types\ForceReply;
use TelegramBot\Api\Types\ReplyKeyboardMarkup;
/**
* Class Client
*
* @package TelegramBot\Api
* @method Message editMessageText(string $chatId, int $messageId, string $text, string $parseMode = null, bool $disablePreview = false, ReplyKeyboardMarkup|ForceReply|ReplyKeyboardRemove|InlineKeyboardMarkup|null $replyMarkup = null, string $inlineMessageId = null)
*/
class Client
{
/**
* RegExp for bot commands
*/
const REGEXP = '/^(?:@\w+\s)?\/([^\s@]+)(@\S+)?\s?(.*)$/';
/**
* @var \TelegramBot\Api\BotApi
*/
protected $api;
/**
* @var \TelegramBot\Api\Events\EventCollection
*/
protected $events;
/**
* Client constructor
*
* @param string $token Telegram Bot API token
* @param string|null $trackerToken Yandex AppMetrica application api_key
*/
public function __construct($token, $trackerToken = null)
{
if ($trackerToken) {
@trigger_error(sprintf('Passing $trackerToken to %s is deprecated', self::class), \E_USER_DEPRECATED);
}
$this->api = new BotApi($token);
$this->events = new EventCollection($trackerToken);
}
/**
* Use this method to add command. Parameters will be automatically parsed and passed to closure.
*
* @param string $name
* @param \Closure $action
*
* @return \TelegramBot\Api\Client
*/
public function command($name, Closure $action)
{
return $this->on(self::getEvent($action), self::getChecker($name));
}
/**
* @return self
*/
public function editedMessage(Closure $action)
{
return $this->on(self::getEditedMessageEvent($action), self::getEditedMessageChecker());
}
/**
* @return self
*/
public function callbackQuery(Closure $action)
{
return $this->on(self::getCallbackQueryEvent($action), self::getCallbackQueryChecker());
}
/**
* @return self
*/
public function channelPost(Closure $action)
{
return $this->on(self::getChannelPostEvent($action), self::getChannelPostChecker());
}
/**
* @return self
*/
public function editedChannelPost(Closure $action)
{
return $this->on(self::getEditedChannelPostEvent($action), self::getEditedChannelPostChecker());
}
/**
* @return self
*/
public function inlineQuery(Closure $action)
{
return $this->on(self::getInlineQueryEvent($action), self::getInlineQueryChecker());
}
/**
* @return self
*/
public function chosenInlineResult(Closure $action)
{
return $this->on(self::getChosenInlineResultEvent($action), self::getChosenInlineResultChecker());
}
/**
* @return self
*/
public function shippingQuery(Closure $action)
{
return $this->on(self::getShippingQueryEvent($action), self::getShippingQueryChecker());
}
/**
* @return self
*/
public function preCheckoutQuery(Closure $action)
{
return $this->on(self::getPreCheckoutQueryEvent($action), self::getPreCheckoutQueryChecker());
}
/**
* Use this method to add an event.
* If second closure will return true (or if you are passed null instead of closure), first one will be executed.
*
* @param \Closure $event
* @param \Closure|null $checker
*
* @return \TelegramBot\Api\Client
*/
public function on(Closure $event, Closure $checker = null)
{
$this->events->add($event, $checker);
return $this;
}
/**
* Handle updates
*
* @param Update[] $updates
*
* @return void
*/
public function handle(array $updates)
{
foreach ($updates as $update) {
/* @var \TelegramBot\Api\Types\Update $update */
$this->events->handle($update);
}
}
/**
* Webhook handler
*
* @return void
* @throws \TelegramBot\Api\InvalidJsonException
*/
public function run()
{
if ($data = BotApi::jsonValidate((string) $this->getRawBody(), true)) {
/** @var array $data */
$this->handle([Update::fromResponse($data)]);
}
}
/**
* @return false|string
*/
public function getRawBody()
{
return file_get_contents('php://input');
}
/**
* Returns event function to handling the command.
*
* @param \Closure $action
*
* @return \Closure
*/
protected static function getEvent(Closure $action)
{
return function (Update $update) use ($action) {
$message = $update->getMessage();
if (!$message) {
return true;
}
preg_match(self::REGEXP, (string) $message->getText(), $matches);
if (isset($matches[3]) && !empty($matches[3])) {
$parameters = str_getcsv($matches[3], chr(32));
} else {
$parameters = [];
}
array_unshift($parameters, $message);
$action = new ReflectionFunction($action);
if (count($parameters) >= $action->getNumberOfRequiredParameters()) {
$action->invokeArgs($parameters);
}
return false;
};
}
/**
* @return Closure
*/
protected static function getEditedMessageEvent(Closure $action)
{
return function (Update $update) use ($action) {
if (!$update->getEditedMessage()) {
return true;
}
$reflectionAction = new ReflectionFunction($action);
$reflectionAction->invokeArgs([$update->getEditedMessage()]);
return false;
};
}
/**
* @return Closure
*
* @psalm-return Closure(Update):bool
*/
protected static function getChannelPostEvent(Closure $action)
{
return function (Update $update) use ($action) {
if (!$update->getChannelPost()) {
return true;
}
$reflectionAction = new ReflectionFunction($action);
$reflectionAction->invokeArgs([$update->getChannelPost()]);
return false;
};
}
/**
* @return Closure
*/
protected static function getCallbackQueryEvent(Closure $action)
{
return function (Update $update) use ($action) {
if (!$update->getCallbackQuery()) {
return true;
}
$reflectionAction = new ReflectionFunction($action);
$reflectionAction->invokeArgs([$update->getCallbackQuery()]);
return false;
};
}
/**
* @return Closure
*
* @psalm-return Closure(Update):bool
*/
protected static function getEditedChannelPostEvent(Closure $action)
{
return function (Update $update) use ($action) {
if (!$update->getEditedChannelPost()) {
return true;
}
$reflectionAction = new ReflectionFunction($action);
$reflectionAction->invokeArgs([$update->getEditedChannelPost()]);
return false;
};
}
/**
* @return Closure
*/
protected static function getInlineQueryEvent(Closure $action)
{
return function (Update $update) use ($action) {
if (!$update->getInlineQuery()) {
return true;
}
$reflectionAction = new ReflectionFunction($action);
$reflectionAction->invokeArgs([$update->getInlineQuery()]);
return false;
};
}
/**
* @return Closure
*
* @psalm-return Closure(Update):bool
*/
protected static function getChosenInlineResultEvent(Closure $action)
{
return function (Update $update) use ($action) {
if (!$update->getChosenInlineResult()) {
return true;
}
$reflectionAction = new ReflectionFunction($action);
$reflectionAction->invokeArgs([$update->getChosenInlineResult()]);
return false;
};
}
/**
* @return Closure
*/
protected static function getShippingQueryEvent(Closure $action)
{
return function (Update $update) use ($action) {
if (!$update->getShippingQuery()) {
return true;
}
$reflectionAction = new ReflectionFunction($action);
$reflectionAction->invokeArgs([$update->getShippingQuery()]);
return false;
};
}
/**
* @return Closure
*
* @psalm-return Closure(Update):bool
*/
protected static function getPreCheckoutQueryEvent(Closure $action)
{
return function (Update $update) use ($action) {
if (!$update->getPreCheckoutQuery()) {
return true;
}
$reflectionAction = new ReflectionFunction($action);
$reflectionAction->invokeArgs([$update->getPreCheckoutQuery()]);
return false;
};
}
/**
* Returns check function to handling the command.
*
* @param string $name
*
* @return \Closure
*/
protected static function getChecker($name)
{
return function (Update $update) use ($name) {
$message = $update->getMessage();
if (!$message) {
return false;
}
$text = $message->getText();
if (empty($text)) {
return false;
}
preg_match(self::REGEXP, $text, $matches);
return !empty($matches) && $matches[1] == $name;
};
}
/**
* Returns check function to handling the edited message.
*
* @return Closure
*/
protected static function getEditedMessageChecker()
{
return function (Update $update) {
return !is_null($update->getEditedMessage());
};
}
/**
* Returns check function to handling the channel post.
*
* @return Closure
*/
protected static function getChannelPostChecker()
{
return function (Update $update) {
return !is_null($update->getChannelPost());
};
}
/**
* Returns check function to handling the callbackQuery.
*
* @return Closure
*/
protected static function getCallbackQueryChecker()
{
return function (Update $update) {
return !is_null($update->getCallbackQuery());
};
}
/**
* Returns check function to handling the edited channel post.
*
* @return Closure
*/
protected static function getEditedChannelPostChecker()
{
return function (Update $update) {
return !is_null($update->getEditedChannelPost());
};
}
/**
* Returns check function to handling the chosen inline result.
*
* @return Closure
*/
protected static function getChosenInlineResultChecker()
{
return function (Update $update) {
return !is_null($update->getChosenInlineResult());
};
}
/**
* Returns check function to handling the inline queries.
*
* @return Closure
*/
protected static function getInlineQueryChecker()
{
return function (Update $update) {
return !is_null($update->getInlineQuery());
};
}
/**
* Returns check function to handling the shipping queries.
*
* @return Closure
*/
protected static function getShippingQueryChecker()
{
return function (Update $update) {
return !is_null($update->getShippingQuery());
};
}
/**
* Returns check function to handling the pre checkout queries.
*
* @return Closure
*/
protected static function getPreCheckoutQueryChecker()
{
return function (Update $update) {
return !is_null($update->getPreCheckoutQuery());
};
}
/**
* @param string $name
* @param array $arguments
* @return mixed
* @throws BadMethodCallException
*/
public function __call($name, array $arguments)
{
if (method_exists($this, $name)) {
return call_user_func_array([$this, $name], $arguments);
} elseif (method_exists($this->api, $name)) {
return call_user_func_array([$this->api, $name], $arguments);
}
throw new BadMethodCallException("Method {$name} not exists");
}
}

View File

@@ -0,0 +1,106 @@
<?php
namespace TelegramBot\Api\Collection;
/**
* @extends \ArrayObject<string|array-key, CollectionItemInterface>
*/
class Collection extends \ArrayObject
{
/**
* @var int Max items count, if set 0 - unlimited
*/
protected $maxCount = 0;
/**
* @param CollectionItemInterface[] $items
*/
public function __construct(array $items = [])
{
parent::__construct($items);
}
/**
* @param CollectionItemInterface $item
* @param mixed $key
* @return void
* @throws ReachedMaxSizeException
* @throws KeyHasUseException
*/
public function addItem(CollectionItemInterface $item, $key = null)
{
if ($this->maxCount > 0 && $this->count() + 1 > $this->maxCount) {
throw new ReachedMaxSizeException("Maximum collection items count reached. Max size: {$this->maxCount}");
}
if ($key == null) {
$this->append($item);
} else {
if ($this->offsetExists($key)) {
throw new KeyHasUseException("Key $key already in use.");
}
$this->offsetSet($key, $item);
}
}
/**
* @param int|string $key
* @throws KeyInvalidException
* @return void
*/
public function deleteItem($key)
{
$this->checkItemKey($key);
$this->offsetUnset($key);
}
/**
* @param int|string $key
* @return CollectionItemInterface
* @throws KeyInvalidException
*/
public function getItem($key)
{
$this->checkItemKey($key);
return $this->offsetGet($key);
}
/**
* @param bool $inner
* @return array|string
*/
public function toJson($inner = false)
{
$output = [];
foreach ($this as $item) {
$output[] = $item->toJson(true);
}
return $inner === false ? json_encode($output) : $output;
}
/**
* @param int $maxCount
* @return void
*/
public function setMaxCount($maxCount)
{
$this->maxCount = $maxCount;
}
/**
* @param int|string $key
*
* @throws KeyInvalidException
*
* @return void
*/
private function checkItemKey($key)
{
if (!$this->offsetExists($key)) {
throw new KeyInvalidException("Invalid key $key.");
}
}
}

View File

@@ -0,0 +1,12 @@
<?php
namespace TelegramBot\Api\Collection;
interface CollectionItemInterface
{
/**
* @param bool $inner
* @return array|string
*/
public function toJson($inner = false);
}

View File

@@ -0,0 +1,15 @@
<?php
namespace TelegramBot\Api\Collection;
use TelegramBot\Api\Exception;
/**
* Class KeyHasUseException
*
* @codeCoverageIgnore
* @package TelegramBot\Api
*/
class KeyHasUseException extends Exception
{
}

View File

@@ -0,0 +1,15 @@
<?php
namespace TelegramBot\Api\Collection;
use TelegramBot\Api\Exception;
/**
* Class KeyInvalidException
*
* @codeCoverageIgnore
* @package TelegramBot\Api
*/
class KeyInvalidException extends Exception
{
}

View File

@@ -0,0 +1,15 @@
<?php
namespace TelegramBot\Api\Collection;
use TelegramBot\Api\Exception;
/**
* Class ReachedMaxSizeException
*
* @codeCoverageIgnore
* @package TelegramBot\Api
*/
class ReachedMaxSizeException extends Exception
{
}

66
vendor/telegram-bot/api/src/Events/Event.php vendored Executable file
View File

@@ -0,0 +1,66 @@
<?php
namespace TelegramBot\Api\Events;
use TelegramBot\Api\Types\Update;
class Event
{
/**
* @var \Closure|null
*/
protected $checker;
/**
* @var \Closure
*/
protected $action;
/**
* Event constructor.
*
* @param \Closure $action
* @param \Closure|null $checker
*/
public function __construct(\Closure $action, \Closure $checker = null)
{
$this->action = $action;
$this->checker = $checker;
}
/**
* @return \Closure
*/
public function getAction()
{
return $this->action;
}
/**
* @return \Closure|null
*/
public function getChecker()
{
return $this->checker;
}
/**
* @return mixed
*/
public function executeChecker(Update $message)
{
if (is_callable($this->checker)) {
return call_user_func($this->checker, $message);
}
return false;
}
/**
* @return mixed
*/
public function executeAction(Update $message)
{
return call_user_func($this->action, $message);
}
}

View File

@@ -0,0 +1,75 @@
<?php
namespace TelegramBot\Api\Events;
use Closure;
use ReflectionFunction;
use TelegramBot\Api\Botan;
use TelegramBot\Api\Types\Update;
class EventCollection
{
/**
* Array of events.
*
* @var array
*/
protected $events;
/**
* Botan tracker
*
* @var \TelegramBot\Api\Botan|null
*/
protected $tracker;
/**
* EventCollection constructor.
*
* @param string $trackerToken
*/
public function __construct($trackerToken = null)
{
$this->events = [];
if ($trackerToken) {
@trigger_error(sprintf('Passing $trackerToken to %s is deprecated', self::class), \E_USER_DEPRECATED);
$this->tracker = new Botan($trackerToken);
}
}
/**
* Add new event to collection
*
* @param Closure $event
* @param Closure|null $checker
*
* @return \TelegramBot\Api\Events\EventCollection
*/
public function add(Closure $event, $checker = null)
{
$this->events[] = !is_null($checker) ? new Event($event, $checker)
: new Event($event, function () {
});
return $this;
}
/**
* @return void
*/
public function handle(Update $update)
{
foreach ($this->events as $event) {
/* @var \TelegramBot\Api\Events\Event $event */
if ($event->executeChecker($update) === true) {
if ($event->executeAction($update) === false) {
if ($this->tracker && ($message = $update->getMessage())) {
$checker = new ReflectionFunction($event->getChecker());
$this->tracker->track($message, $checker->getStaticVariables()['name']);
}
break;
}
}
}
}
}

13
vendor/telegram-bot/api/src/Exception.php vendored Executable file
View File

@@ -0,0 +1,13 @@
<?php
namespace TelegramBot\Api;
/**
* Class Exception
*
* @codeCoverageIgnore
* @package TelegramBot\Api
*/
class Exception extends \Exception
{
}

40
vendor/telegram-bot/api/src/HttpException.php vendored Executable file
View File

@@ -0,0 +1,40 @@
<?php
namespace TelegramBot\Api;
/**
* Class HttpException
*
* @codeCoverageIgnore
* @package TelegramBot\Api
*/
class HttpException extends Exception
{
/**
* @var array
*/
protected $parameters = [];
/**
* HttpException constructor.
*
* @param string $message [optional] The Exception message to throw.
* @param int $code [optional] The Exception code.
* @param Exception $previous [optional] The previous throwable used for the exception chaining.
* @param array $parameters [optional] Array of parameters returned from API.
*/
public function __construct($message = '', $code = 0, Exception $previous = null, $parameters = [])
{
$this->parameters = $parameters;
parent::__construct($message, $code, $previous);
}
/**
* @return array
*/
public function getParameters()
{
return $this->parameters;
}
}

View File

@@ -0,0 +1,13 @@
<?php
namespace TelegramBot\Api;
/**
* Class InvalidArgumentException
*
* @codeCoverageIgnore
* @package TelegramBot\Api
*/
class InvalidArgumentException extends Exception
{
}

View File

@@ -0,0 +1,13 @@
<?php
namespace TelegramBot\Api;
/**
* Class InvalidJsonException
*
* @codeCoverageIgnore
* @package TelegramBot\Api
*/
class InvalidJsonException extends Exception
{
}

12
vendor/telegram-bot/api/src/TypeInterface.php vendored Executable file
View File

@@ -0,0 +1,12 @@
<?php
namespace TelegramBot\Api;
interface TypeInterface
{
/**
* @param array $data
* @return static
*/
public static function fromResponse($data);
}

View File

@@ -0,0 +1,298 @@
<?php
namespace TelegramBot\Api\Types;
use TelegramBot\Api\BaseType;
use TelegramBot\Api\InvalidArgumentException;
use TelegramBot\Api\TypeInterface;
/**
* Class Animation
* This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).
*
* @package TelegramBot\Api\Types
*/
class Animation extends BaseType implements TypeInterface
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['file_id', 'file_unique_id', 'width', 'height', 'duration'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'file_id' => true,
'file_unique_id' => true,
'width' => true,
'height' => true,
'duration' => true,
'thumbnail' => PhotoSize::class,
'file_name' => true,
'mime_type' => true,
'file_size' => true
];
/**
* Unique file identifier
*
* @var string
*/
protected $fileId;
/**
* Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
*
* @var string
*/
protected $fileUniqueId;
/**
* Video width as defined by sender
*
* @var int
*/
protected $width;
/**
* Video height as defined by sender
*
* @var int
*/
protected $height;
/**
* Duration of the video in seconds as defined by sender
*
* @var int
*/
protected $duration;
/**
* Video thumbnail
*
* @var PhotoSize
*/
protected $thumbnail;
/**
* Optional. Animation thumbnail as defined by sender
*
* @var string|null
*/
protected $fileName;
/**
* Optional. Mime type of a file as defined by sender
*
* @var string|null
*/
protected $mimeType;
/**
* Optional. File size
*
* @var int|null
*/
protected $fileSize;
/**
* @return int
*/
public function getDuration()
{
return $this->duration;
}
/**
* @param mixed $duration
* @return void
* @throws InvalidArgumentException
*/
public function setDuration($duration)
{
if (is_integer($duration)) {
$this->duration = $duration;
} else {
throw new InvalidArgumentException();
}
}
/**
* @return string
*/
public function getFileId()
{
return $this->fileId;
}
/**
* @param string $fileId
* @return void
*/
public function setFileId($fileId)
{
$this->fileId = $fileId;
}
/**
* @return string
*/
public function getFileUniqueId()
{
return $this->fileUniqueId;
}
/**
* @param string $fileUniqueId
* @return void
*/
public function setFileUniqueId($fileUniqueId)
{
$this->fileUniqueId = $fileUniqueId;
}
/**
* @return int|null
*/
public function getFileSize()
{
return $this->fileSize;
}
/**
* @param mixed $fileSize
* @return void
* @throws InvalidArgumentException
*/
public function setFileSize($fileSize)
{
if (is_integer($fileSize)) {
$this->fileSize = $fileSize;
} else {
throw new InvalidArgumentException();
}
}
/**
* @return int
*/
public function getHeight()
{
return $this->height;
}
/**
* @param mixed $height
* @return void
* @throws InvalidArgumentException
*/
public function setHeight($height)
{
if (is_integer($height)) {
$this->height = $height;
} else {
throw new InvalidArgumentException();
}
}
/**
* @return null|string
*/
public function getMimeType()
{
return $this->mimeType;
}
/**
* @param string $mimeType
* @return void
*/
public function setMimeType($mimeType)
{
$this->mimeType = $mimeType;
}
/**
* @return PhotoSize
*/
public function getThumbnail()
{
return $this->thumbnail;
}
/**
* @param PhotoSize $thumbnail
* @return void
*/
public function setThumbnail(PhotoSize $thumbnail)
{
$this->thumbnail = $thumbnail;
}
/**
* @deprecated use getThumbnail method
*
* @return PhotoSize|null
*/
public function getThumb()
{
return $this->getThumbnail();
}
/**
* @deprecated use setThumbnail method
*
* @param PhotoSize $thumb
*
* @return void
*/
public function setThumb($thumb)
{
$this->setThumbnail($thumb);
}
/**
* @return null|string $fileName
*/
public function getFileName()
{
return $this->fileName;
}
/**
* @param string $fileName
* @return void
*/
public function setFileName($fileName)
{
$this->fileName = $fileName;
}
/**
* @return int
*/
public function getWidth()
{
return $this->width;
}
/**
* @param mixed $width
* @return void
* @throws InvalidArgumentException
*/
public function setWidth($width)
{
if (is_integer($width)) {
$this->width = $width;
} else {
throw new InvalidArgumentException();
}
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace TelegramBot\Api\Types;
abstract class ArrayOfArrayOfPhotoSize
{
/**
* @param array $data
* @return PhotoSize[][]
*/
public static function fromResponse($data)
{
return array_map(function ($arrayOfPhotoSize) {
return ArrayOfPhotoSize::fromResponse($arrayOfPhotoSize);
}, $data);
}
}

View File

@@ -0,0 +1,19 @@
<?php
namespace TelegramBot\Api\Types;
use TelegramBot\Api\Collection\Collection;
use TelegramBot\Api\TypeInterface;
final class ArrayOfBotCommand extends Collection implements TypeInterface
{
public static function fromResponse($data)
{
$arrayOfBotCommand = new self();
foreach ($data as $botCommand) {
$arrayOfBotCommand->addItem(BotCommand::fromResponse($botCommand));
}
return $arrayOfBotCommand;
}
}

View File

@@ -0,0 +1,20 @@
<?php
namespace TelegramBot\Api\Types;
abstract class ArrayOfChatMemberEntity
{
/**
* @param array $data
* @return ChatMember[]
*/
public static function fromResponse($data)
{
$arrayOfChatMemberEntity = [];
foreach ($data as $chatMemberEntity) {
$arrayOfChatMemberEntity[] = ChatMember::fromResponse($chatMemberEntity);
}
return $arrayOfChatMemberEntity;
}
}

View File

@@ -0,0 +1,26 @@
<?php
/**
* Created by PhpStorm.
* User: iGusev
* Date: 13/04/16
* Time: 04:16
*/
namespace TelegramBot\Api\Types;
abstract class ArrayOfMessageEntity
{
/**
* @param array $data
* @return MessageEntity[]
*/
public static function fromResponse($data)
{
$arrayOfMessageEntity = [];
foreach ($data as $messageEntity) {
$arrayOfMessageEntity[] = MessageEntity::fromResponse($messageEntity);
}
return $arrayOfMessageEntity;
}
}

View File

@@ -0,0 +1,20 @@
<?php
namespace TelegramBot\Api\Types;
abstract class ArrayOfMessages
{
/**
* @param array $data
* @return Message[]
*/
public static function fromResponse($data)
{
$arrayOfMessages = [];
foreach ($data as $message) {
$arrayOfMessages[] = Message::fromResponse($message);
}
return $arrayOfMessages;
}
}

View File

@@ -0,0 +1,20 @@
<?php
namespace TelegramBot\Api\Types;
abstract class ArrayOfPhotoSize
{
/**
* @param array $data
* @return PhotoSize[]
*/
public static function fromResponse($data)
{
$arrayOfPhotoSize = [];
foreach ($data as $photoSizeItem) {
$arrayOfPhotoSize[] = PhotoSize::fromResponse($photoSizeItem);
}
return $arrayOfPhotoSize;
}
}

View File

@@ -0,0 +1,20 @@
<?php
namespace TelegramBot\Api\Types;
abstract class ArrayOfPollOption
{
/**
* @param array $data
* @return PollOption[]
*/
public static function fromResponse($data)
{
$arrayOfPollOption = [];
foreach ($data as $pollOptionItem) {
$arrayOfPollOption[] = PollOption::fromResponse($pollOptionItem);
}
return $arrayOfPollOption;
}
}

View File

@@ -0,0 +1,20 @@
<?php
namespace TelegramBot\Api\Types;
abstract class ArrayOfSticker
{
/**
* @param array $data
* @return Sticker[]
*/
public static function fromResponse($data)
{
$arrayOfStickers = [];
foreach ($data as $sticker) {
$arrayOfStickers[] = Sticker::fromResponse($sticker);
}
return $arrayOfStickers;
}
}

View File

@@ -0,0 +1,20 @@
<?php
namespace TelegramBot\Api\Types;
abstract class ArrayOfUpdates
{
/**
* @param array $data
* @return Update[]
*/
public static function fromResponse($data)
{
$arrayOfUpdates = [];
foreach ($data as $update) {
$arrayOfUpdates[] = Update::fromResponse($update);
}
return $arrayOfUpdates;
}
}

View File

@@ -0,0 +1,20 @@
<?php
namespace TelegramBot\Api\Types;
abstract class ArrayOfUser
{
/**
* @param array $data
* @return User[]
*/
public static function fromResponse($data)
{
$arrayOfUsers = [];
foreach ($data as $user) {
$arrayOfUsers[] = User::fromResponse($user);
}
return $arrayOfUsers;
}
}

216
vendor/telegram-bot/api/src/Types/Audio.php vendored Executable file
View File

@@ -0,0 +1,216 @@
<?php
namespace TelegramBot\Api\Types;
use TelegramBot\Api\BaseType;
use TelegramBot\Api\InvalidArgumentException;
use TelegramBot\Api\TypeInterface;
/**
* Class Audio
* This object represents an audio file (voice note).
*
* @package TelegramBot\Api\Types
*/
class Audio extends BaseType implements TypeInterface
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['file_id', 'file_unique_id', 'duration'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'file_id' => true,
'file_unique_id' => true,
'duration' => true,
'performer' => true,
'title' => true,
'mime_type' => true,
'file_size' => true
];
/**
* Unique identifier for this file
*
* @var string
*/
protected $fileId;
/**
* Photo width
*
* @var int
*/
protected $duration;
/**
* Optional. Performer of the audio as defined by sender or by audio tags
*
* @var string|null
*/
protected $performer;
/**
* Optional. Title of the audio as defined by sender or by audio tags
*
* @var string|null
*/
protected $title;
/**
* Optional. MIME type of the file as defined by sender
*
* @var string|null
*/
protected $mimeType;
/**
* Optional. File size
*
* @var int|null
*/
protected $fileSize;
/**
* Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
*
* @var string
*/
protected $fileUniqueId;
/**
* @return int
*/
public function getDuration()
{
return $this->duration;
}
/**
* @param mixed $duration
* @return void
* @throws InvalidArgumentException
*/
public function setDuration($duration)
{
if (is_integer($duration)) {
$this->duration = $duration;
} else {
throw new InvalidArgumentException();
}
}
/**
* @return null|string
*/
public function getPerformer()
{
return $this->performer;
}
/**
* @param string $performer
* @return void
*/
public function setPerformer($performer)
{
$this->performer = $performer;
}
/**
* @return null|string
*/
public function getTitle()
{
return $this->title;
}
/**
* @param string $title
* @return void
*/
public function setTitle($title)
{
$this->title = $title;
}
/**
* @return string
*/
public function getFileId()
{
return $this->fileId;
}
/**
* @param string $fileId
* @return void
*/
public function setFileId($fileId)
{
$this->fileId = $fileId;
}
/**
* @return int|null
*/
public function getFileSize()
{
return $this->fileSize;
}
/**
* @param mixed $fileSize
* @return void
* @throws InvalidArgumentException
*/
public function setFileSize($fileSize)
{
if (is_integer($fileSize)) {
$this->fileSize = $fileSize;
} else {
throw new InvalidArgumentException();
}
}
/**
* @return null|string
*/
public function getMimeType()
{
return $this->mimeType;
}
/**
* @param string $mimeType
* @return void
*/
public function setMimeType($mimeType)
{
$this->mimeType = $mimeType;
}
/**
* @return string
*/
public function getFileUniqueId()
{
return $this->fileUniqueId;
}
/**
* @param string $fileUniqueId
* @return void
*/
public function setFileUniqueId($fileUniqueId)
{
$this->fileUniqueId = $fileUniqueId;
}
}

View File

@@ -0,0 +1,75 @@
<?php
namespace TelegramBot\Api\Types;
use TelegramBot\Api\BaseType;
use TelegramBot\Api\Collection\CollectionItemInterface;
use TelegramBot\Api\TypeInterface;
class BotCommand extends BaseType implements TypeInterface, CollectionItemInterface
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['command', 'description'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'command' => true,
'description' => true,
];
/**
* Text of the command, 1-32 characters. Can contain only lowercase English letters, digits and underscores.
*
* @var string
*/
protected $command;
/**
* Description of the command, 3-256 characters.
*
* @var string
*/
protected $description;
/**
* @return string
*/
public function getCommand()
{
return $this->command;
}
/**
* @param string $command
* @return void
*/
public function setCommand($command)
{
$this->command = $command;
}
/**
* @return string
*/
public function getDescription()
{
return $this->description;
}
/**
* @param string $description
* @return void
*/
public function setDescription($description)
{
$this->description = $description;
}
}

View File

@@ -0,0 +1,216 @@
<?php
namespace TelegramBot\Api\Types;
use TelegramBot\Api\BaseType;
/**
* Class CallbackQuery
* This object represents an incoming callback query from a callback
* button in an inline keyboard.
* If the button that originated the query was attached to a message sent by the bot,
* the field message will be present.
* If the button was attached to a message sent via the bot (in inline mode),
* the field inline_message_id will be present.
* Exactly one of the fields data or game_short_name will be present.
*
* @package TelegramBot\Api\Types
*/
class CallbackQuery extends BaseType
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['id', 'from'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'id' => true,
'from' => User::class,
'message' => Message::class,
'inline_message_id' => true,
'chat_instance' => true,
'data' => true,
'game_short_name' => true
];
/**
* Unique identifier for this query
*
* @var string
*/
protected $id;
/**
* Sender
*
* @var \TelegramBot\Api\Types\User
*/
protected $from;
/**
* Optional. Message with the callback button that originated the query.
* Note that message content and message date will not be available
* if the message is too old
*
* @var \TelegramBot\Api\Types\Message|null
*/
protected $message;
/**
* Optional. Identifier of the message sent via the bot in inline mode,
* that originated the query.
*
* @var string|null
*/
protected $inlineMessageId;
/**
* Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent.
* Useful for high scores in games.
*
* @var string
*/
protected $chatInstance;
/**
* Optional. Data associated with the callback button.
* Be aware that a bad client can send arbitrary data in this field.
*
* @var string|null
*/
protected $data;
/**
* Optional. Short name of a Game to be returned,
* serves as the unique identifier for the game
*
* @var string|null
*/
protected $gameShortName;
/**
* @return string
*/
public function getId()
{
return $this->id;
}
/**
* @param string $id
* @return void
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @return User
*/
public function getFrom()
{
return $this->from;
}
/**
* @param User $from
* @return void
*/
public function setFrom(User $from)
{
$this->from = $from;
}
/**
* @return Message|null
*/
public function getMessage()
{
return $this->message;
}
/**
* @param Message $message
* @return void
*/
public function setMessage($message)
{
$this->message = $message;
}
/**
* @return null|string
*/
public function getInlineMessageId()
{
return $this->inlineMessageId;
}
/**
* @param string $inlineMessageId
* @return void
*/
public function setInlineMessageId($inlineMessageId)
{
$this->inlineMessageId = $inlineMessageId;
}
/**
* @return string
*/
public function getChatInstance()
{
return $this->chatInstance;
}
/**
* @param string $chatInstance
* @return void
*/
public function setChatInstance($chatInstance)
{
$this->chatInstance = $chatInstance;
}
/**
* @return null|string
*/
public function getData()
{
return $this->data;
}
/**
* @param string $data
* @return void
*/
public function setData($data)
{
$this->data = $data;
}
/**
* @return null|string
*/
public function getGameShortName()
{
return $this->gameShortName;
}
/**
* @param string $gameShortName
* @return void
*/
public function setGameShortName($gameShortName)
{
$this->gameShortName = $gameShortName;
}
}

691
vendor/telegram-bot/api/src/Types/Chat.php vendored Executable file
View File

@@ -0,0 +1,691 @@
<?php
namespace TelegramBot\Api\Types;
use TelegramBot\Api\BaseType;
use TelegramBot\Api\InvalidArgumentException;
use TelegramBot\Api\TypeInterface;
class Chat extends BaseType implements TypeInterface
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['id', 'type'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'id' => true,
'type' => true,
'title' => true,
'username' => true,
'first_name' => true,
'last_name' => true,
'photo' => ChatPhoto::class,
'bio' => true,
'description' => true,
'invite_link' => true,
'pinned_message' => Message::class,
'permissions' => ChatPermissions::class,
'slow_mode_delay' => true,
'sticker_set_name' => true,
'can_set_sticker_set' => true,
'linked_chat_id' => true,
'location' => ChatLocation::class,
'join_to_send_messages' => true,
'join_by_request' => true,
'message_auto_delete_time' => true,
'has_protected_content' => true,
'is_forum' => true,
'active_usernames' => true,
'emoji_status_custom_emoji_id' => true,
'has_private_forwards' => true,
'has_restricted_voice_and_video_messages' => true,
];
/**
* Unique identifier for this chat, not exceeding 1e13 by absolute value
*
* @var int|float|string
*/
protected $id;
/**
* Type of chat, can be either “private”, “group”, “supergroup” or “channel”
*
* @var string
*/
protected $type;
/**
* Optional. Title, for channels and group chats
*
* @var string|null
*/
protected $title;
/**
* Optional. Username, for private chats and channels if available
*
* @var string|null
*/
protected $username;
/**
* Optional. First name of the other party in a private chat
*
* @var string|null
*/
protected $firstName;
/**
* Optional. Last name of the other party in a private chat
*
* @var string|null
*/
protected $lastName;
/**
* Optional. Chat photo. Returned only in getChat.
*
* @var ChatPhoto|null
*/
protected $photo;
/**
* Optional. Bio of the other party in a private chat. Returned only in getChat
*
* @var string|null
*/
protected $bio;
/**
* Optional. Description, for supergroups and channel chats. Returned only in getChat.
*
* @var string|null
*/
protected $description;
/**
* Optional. Chat invite link, for supergroups and channel chats. Returned only in getChat.
*
* @var string|null
*/
protected $inviteLink;
/**
* Optional. Pinned message, for supergroups. Returned only in getChat.
*
* @var Message|null
*/
protected $pinnedMessage;
/**
* Optional. Default chat member permissions, for groups and supergroups. Returned only in getChat.
*
* @var ChatPermissions|null
*/
protected $permissions;
/**
* Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged
* user. Returned only in getChat.
*
* @var int|null
*/
protected $slowModeDelay;
/**
* Optional. For supergroups, name of group sticker set. Returned only in getChat.
*
* @var string|null
*/
protected $stickerSetName;
/**
* Optional. True, if the bot can change the group sticker set. Returned only in getChat.
*
* @var bool|null
*/
protected $canSetStickerSet;
/**
* Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice
* versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming
* languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64
* bit integer or double-precision float type are safe for storing this identifier. Returned only in getChat.
*
* @var int|null
*/
protected $linkedChatId;
/**
* Optional. For supergroups, the location to which the supergroup is connected. Returned only in getChat.
*
* @var ChatLocation|null
*/
protected $location;
/**
* Optional. True, if users need to join the supergroup before they can send messages. Returned only in getChat.
*
* @var bool|null
*/
protected $joinToSendMessages;
/**
* Optional. True, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in getChat.
*
* @var bool|null
*/
protected $joinByRequest;
/**
* Optional. Time after which all messages sent to the chat will be automatically deleted; in seconds. Returned
* only in getChat.
*
* @var int|null
*/
protected $messageAutoDeleteTime;
/**
* Optional. True, if messages from the chat can't be forwarded to other chats. Returned only in getChat.
*
* @var bool|null
*/
protected $hasProtectedContent;
/**
* Optional. True, if the supergroup chat is a forum (has topics enabled)
*
* @var bool|null
*/
protected $isForum;
/**
* Optional. If non-empty, the list of all active chat usernames;
* for private chats, supergroups and channels. Returned only in getChat.
*
* @var array[]|null
*/
protected $activeUsernames;
/**
* Optional. Custom emoji identifier of emoji status of the other party in a private chat. Returned only in getChat.
*
* @var string|null
*/
protected $emojiStatusCustomEmojiId;
/**
* Optional. True, if privacy settings of the other party in the private chat allows
* to use tg://user?id=<user_id> links only in chats with the user.
* Returned only in getChat.
*
* @var bool|null
*/
protected $hasPrivateForwards;
/**
* Optional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat.
* Returned only in getChat.
*
* @var bool|null
*/
protected $hasRestrictedVoiceAndVideoMessages;
/**
* @return int|float|string
*/
public function getId()
{
return $this->id;
}
/**
* @param mixed $id
* @return void
* @throws InvalidArgumentException
*/
public function setId($id)
{
if (is_integer($id) || is_float($id) || is_string($id)) {
$this->id = $id;
} else {
throw new InvalidArgumentException();
}
}
/**
* @return string
*/
public function getType()
{
return $this->type;
}
/**
* @param string $type
* @return void
*/
public function setType($type)
{
$this->type = $type;
}
/**
* @return null|string
*/
public function getTitle()
{
return $this->title;
}
/**
* @param string $title
* @return void
*/
public function setTitle($title)
{
$this->title = $title;
}
/**
* @return null|string
*/
public function getUsername()
{
return $this->username;
}
/**
* @param string $username
* @return void
*/
public function setUsername($username)
{
$this->username = $username;
}
/**
* @return null|string
*/
public function getFirstName()
{
return $this->firstName;
}
/**
* @param string $firstName
* @return void
*/
public function setFirstName($firstName)
{
$this->firstName = $firstName;
}
/**
* @return null|string
*/
public function getLastName()
{
return $this->lastName;
}
/**
* @param string $lastName
* @return void
*/
public function setLastName($lastName)
{
$this->lastName = $lastName;
}
/**
* @return ChatPhoto|null
*/
public function getPhoto()
{
return $this->photo;
}
/**
* @param ChatPhoto $photo
* @return void
*/
public function setPhoto($photo)
{
$this->photo = $photo;
}
/**
* @return null|string
*/
public function getBio()
{
return $this->bio;
}
/**
* @param string $bio
* @return void
*/
public function setBio($bio)
{
$this->bio = $bio;
}
/**
* @return null|string
*/
public function getDescription()
{
return $this->description;
}
/**
* @param string $description
* @return void
*/
public function setDescription($description)
{
$this->description = $description;
}
/**
* @return null|string
*/
public function getInviteLink()
{
return $this->inviteLink;
}
/**
* @param string $inviteLink
* @return void
*/
public function setInviteLink($inviteLink)
{
$this->inviteLink = $inviteLink;
}
/**
* @return Message|null
*/
public function getPinnedMessage()
{
return $this->pinnedMessage;
}
/**
* @param Message $pinnedMessage
* @return void
*/
public function setPinnedMessage($pinnedMessage)
{
$this->pinnedMessage = $pinnedMessage;
}
/**
* @return ChatPermissions|null
*/
public function getPermissions()
{
return $this->permissions;
}
/**
* @param ChatPermissions $permissions
* @return void
*/
public function setPermissions($permissions)
{
$this->permissions = $permissions;
}
/**
* @return int|null
*/
public function getSlowModeDelay()
{
return $this->slowModeDelay;
}
/**
* @param int $slowModeDelay
* @return void
*/
public function setSlowModeDelay($slowModeDelay)
{
$this->slowModeDelay = $slowModeDelay;
}
/**
* @return null|string
*/
public function getStickerSetName()
{
return $this->stickerSetName;
}
/**
* @param string $stickerSetName
* @return void
*/
public function setStickerSetName($stickerSetName)
{
$this->stickerSetName = $stickerSetName;
}
/**
* @return bool|null
*/
public function getCanSetStickerSet()
{
return $this->canSetStickerSet;
}
/**
* @param bool $canSetStickerSet
* @return void
*/
public function setCanSetStickerSet($canSetStickerSet)
{
$this->canSetStickerSet = $canSetStickerSet;
}
/**
* @return int|null
*/
public function getLinkedChatId()
{
return $this->linkedChatId;
}
/**
* @param int $linkedChatId
* @return void
*/
public function setLinkedChatId($linkedChatId)
{
$this->linkedChatId = $linkedChatId;
}
/**
* @return ChatLocation|null
*/
public function getLocation()
{
return $this->location;
}
/**
* @param ChatLocation $location
* @return void
*/
public function setLocation($location)
{
$this->location = $location;
}
/**
* @return bool|null
*/
public function getJoinToSendMessages()
{
return $this->joinToSendMessages;
}
/**
* @param bool $joinToSendMessages
* @return void
*/
public function setJoinToSendMessages($joinToSendMessages)
{
$this->joinToSendMessages = $joinToSendMessages;
}
/**
* @return bool|null
*/
public function getJoinByRequest()
{
return $this->joinByRequest;
}
/**
* @param bool $joinByRequest
* @return void
*/
public function setJoinByRequest($joinByRequest)
{
$this->joinByRequest = $joinByRequest;
}
/**
* @return int|null
*/
public function getMessageAutoDeleteTime()
{
return $this->messageAutoDeleteTime;
}
/**
* @param int $messageAutoDeleteTime
* @return void
*/
public function setMessageAutoDeleteTime($messageAutoDeleteTime)
{
$this->messageAutoDeleteTime = $messageAutoDeleteTime;
}
/**
* @return bool|null
*/
public function getHasProtectedContent()
{
return $this->hasProtectedContent;
}
/**
* @param bool $hasProtectedContent
* @return void
*/
public function setHasProtectedContent($hasProtectedContent)
{
$this->hasProtectedContent = $hasProtectedContent;
}
/**
* @return bool|null
*/
public function getIsForum()
{
return $this->isForum;
}
/**
* @param bool $isForum
* @return void
*/
public function setIsForum($isForum)
{
$this->isForum = $isForum;
}
/**
* @return array[]|null
*
* @psalm-return array<array>|null
*/
public function getActiveUsernames()
{
return $this->activeUsernames;
}
/**
* @param array $activeUsernames
* @return void
*/
public function setActiveUsernames($activeUsernames)
{
$this->activeUsernames = $activeUsernames;
}
/**
* @return null|string
*/
public function getEmojiStatusCustomEmojiId()
{
return $this->emojiStatusCustomEmojiId;
}
/**
* @param string $emojiStatusCustomEmojiId
* @return void
*/
public function setEmojiStatusCustomEmojiId($emojiStatusCustomEmojiId)
{
$this->emojiStatusCustomEmojiId = $emojiStatusCustomEmojiId;
}
/**
* @return bool|null
*/
public function getHasPrivateForwards()
{
return $this->hasPrivateForwards;
}
/**
* @param bool $hasPrivateForwards
* @return void
*/
public function setHasPrivateForwards($hasPrivateForwards)
{
$this->hasPrivateForwards = $hasPrivateForwards;
}
/**
* @return bool|null
*/
public function getHasRestrictedVoiceAndVideoMessages()
{
return $this->hasRestrictedVoiceAndVideoMessages;
}
/**
* @param bool $hasRestrictedVoiceAndVideoMessages
* @return void
*/
public function setHasRestrictedVoiceAndVideoMessages($hasRestrictedVoiceAndVideoMessages)
{
$this->hasRestrictedVoiceAndVideoMessages = $hasRestrictedVoiceAndVideoMessages;
}
}

View File

@@ -0,0 +1,74 @@
<?php
namespace TelegramBot\Api\Types;
use TelegramBot\Api\BaseType;
use TelegramBot\Api\TypeInterface;
class ChatLocation extends BaseType implements TypeInterface
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['location', 'address'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'location' => Location::class,
'address' => true,
];
/**
* The location to which the supergroup is connected. Can't be a live location.
*
* @var Location
*/
protected $location;
/**
* Location address; 1-64 characters, as defined by the chat owner
*
* @var string
*/
protected $address;
/**
* @return Location
*/
public function getLocation()
{
return $this->location;
}
/**
* @param Location $location
* @return void
*/
public function setLocation($location)
{
$this->location = $location;
}
/**
* @return string
*/
public function getAddress()
{
return $this->address;
}
/**
* @param string $address
* @return void
*/
public function setAddress($address)
{
$this->address = $address;
}
}

View File

@@ -0,0 +1,555 @@
<?php
namespace TelegramBot\Api\Types;
use TelegramBot\Api\BaseType;
class ChatMember extends BaseType
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['user', 'status'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'user' => User::class,
'status' => true,
'until_date' => true,
'can_be_edited' => true,
'can_change_info' => true,
'can_post_messages' => true,
'can_edit_messages' => true,
'can_delete_messages' => true,
'can_invite_users' => true,
'can_restrict_members' => true,
'can_pin_messages' => true,
'can_promote_members' => true,
'can_send_messages' => true,
'can_send_media_messages' => true,
'can_send_other_messages' => true,
'can_add_web_page_previews' => true,
'can_manage_topics' => true,
'is_anonymous' => true,
'custom_title' => true,
'can_manage_chat' => true,
'can_send_polls' => true,
];
/**
* Information about the user
*
* @var User
*/
protected $user;
/**
* The member's status in the chat. Can be “creator”, “administrator”, “member”, “restricted”, “left” or “kicked”
*
* @var string
*/
protected $status;
/**
* Optional. Restricted and kicked only. Date when restrictions will be lifted for this user, unix time
*
* @var integer|null
*/
protected $untilDate;
/**
* Optional. Administrators only. True, if the bot is allowed to edit administrator privileges of that user
*
* @var bool|null
*/
protected $canBeEdited;
/**
* Optional. Administrators only. True, if the administrator can change the chat title, photo and other settings
*
* @var bool|null
*/
protected $canChangeInfo;
/**
* Optional. Administrators only. True, if the administrator can post in the channel, channels only
*
* @var bool|null
*/
protected $canPostMessages;
/**
* Optional. Administrators only. True, if the administrator can edit messages of other users, channels only
*
* @var bool|null
*/
protected $canEditMessages;
/**
* Optional. Administrators only. True, if the administrator can delete messages of other users
*
* @var bool|null
*/
protected $canDeleteMessages;
/**
* Optional. Administrators only. True, if the administrator can invite new users to the chat
*
* @var bool|null
*/
protected $canInviteUsers;
/**
* Optional. Administrators only. True, if the administrator can restrict, ban or unban chat members
*
* @var bool|null
*/
protected $canRestrictMembers;
/**
* Optional. Administrators only. True, if the administrator can pin messages, supergroups only
*
* @var bool|null
*/
protected $canPinMessages;
/**
* Optional. Administrators only. True, if the administrator can add new administrators with a subset of his own
* privileges or demote administrators that he has promoted, directly or indirectly
* (promoted by administrators that were appointed by the user)
*
* @var bool|null
*/
protected $canPromoteMembers;
/**
* Optional. Restricted only. True, if the user can send text messages, contacts, locations and venues
*
* @var bool|null
*/
protected $canSendMessages;
/**
* Optional. Restricted only. True, if the user can send audios, documents, photos, videos, video notes
* and voice notes, implies can_send_messages
*
* @var bool|null
*/
protected $canSendMediaMessages;
/**
* Optional. Restricted only. True, if the user can send animations, games, stickers and use inline bots,
* implies can_send_media_messages
*
* @var bool|null
*/
protected $canSendOtherMessages;
/**
* Optional. Restricted only. True, if user may add web page previews to his messages,
* implies can_send_media_messages
*
* @var bool|null
*/
protected $canAddWebPagePreviews;
/**
* Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only
*
* @var bool|null
*/
protected $canManageTopics;
/**
* True, if the user's presence in the chat is hidden
*
* @var bool
*/
protected $isAnonymous;
/**
* Optional. Custom title for this user
*
* @var string|null
*/
protected $customTitle;
/**
* True, if the administrator can access the chat event log, chat statistics, message statistics in channels,
* see channel members, see anonymous administrators in supergroups and ignore slow mode.
* Implied by any other administrator privilege
*
* @var bool
*/
protected $canManageChat;
/**
* True, if the user is allowed to send polls
*
* @var bool
*/
protected $canSendPolls;
/**
* @return User
*/
public function getUser()
{
return $this->user;
}
/**
* @param User $user
* @return void
*/
public function setUser($user)
{
$this->user = $user;
}
/**
* @return string
*/
public function getStatus()
{
return $this->status;
}
/**
* @param string $status
* @return void
*/
public function setStatus($status)
{
$this->status = $status;
}
/**
* @return int|null
*/
public function getUntilDate()
{
return $this->untilDate;
}
/**
* @param int $untilDate
* @return void
*/
public function setUntilDate($untilDate)
{
$this->untilDate = $untilDate;
}
/**
* @return bool|null
*/
public function getCanBeEdited()
{
return $this->canBeEdited;
}
/**
* @param bool $canBeEdited
* @return void
*/
public function setCanBeEdited($canBeEdited)
{
$this->canBeEdited = $canBeEdited;
}
/**
* @return bool|null
*/
public function getCanChangeInfo()
{
return $this->canChangeInfo;
}
/**
* @param bool $canChangeInfo
* @return void
*/
public function setCanChangeInfo($canChangeInfo)
{
$this->canChangeInfo = $canChangeInfo;
}
/**
* @return bool|null
*/
public function getCanPostMessages()
{
return $this->canPostMessages;
}
/**
* @param bool $canPostMessages
* @return void
*/
public function setCanPostMessages($canPostMessages)
{
$this->canPostMessages = $canPostMessages;
}
/**
* @return bool|null
*/
public function getCanEditMessages()
{
return $this->canEditMessages;
}
/**
* @param bool $canEditMessages
* @return void
*/
public function setCanEditMessages($canEditMessages)
{
$this->canEditMessages = $canEditMessages;
}
/**
* @return bool|null
*/
public function getCanDeleteMessages()
{
return $this->canDeleteMessages;
}
/**
* @param bool $canDeleteMessages
* @return void
*/
public function setCanDeleteMessages($canDeleteMessages)
{
$this->canDeleteMessages = $canDeleteMessages;
}
/**
* @return bool|null
*/
public function getCanInviteUsers()
{
return $this->canInviteUsers;
}
/**
* @param bool $canInviteUsers
* @return void
*/
public function setCanInviteUsers($canInviteUsers)
{
$this->canInviteUsers = $canInviteUsers;
}
/**
* @return bool|null
*/
public function getCanRestrictMembers()
{
return $this->canRestrictMembers;
}
/**
* @param bool $canRestrictMembers
* @return void
*/
public function setCanRestrictMembers($canRestrictMembers)
{
$this->canRestrictMembers = $canRestrictMembers;
}
/**
* @return bool|null
*/
public function getCanPinMessages()
{
return $this->canPinMessages;
}
/**
* @param bool $canPinMessages
* @return void
*/
public function setCanPinMessages($canPinMessages)
{
$this->canPinMessages = $canPinMessages;
}
/**
* @return bool|null
*/
public function getCanPromoteMembers()
{
return $this->canPromoteMembers;
}
/**
* @param bool $canPromoteMembers
* @return void
*/
public function setCanPromoteMembers($canPromoteMembers)
{
$this->canPromoteMembers = $canPromoteMembers;
}
/**
* @return bool|null
*/
public function getCanSendMessages()
{
return $this->canSendMessages;
}
/**
* @param bool $canSendMessages
* @return void
*/
public function setCanSendMessages($canSendMessages)
{
$this->canSendMessages = $canSendMessages;
}
/**
* @return bool|null
*/
public function getCanSendMediaMessages()
{
return $this->canSendMediaMessages;
}
/**
* @param bool $canSendMediaMessages
* @return void
*/
public function setCanSendMediaMessages($canSendMediaMessages)
{
$this->canSendMediaMessages = $canSendMediaMessages;
}
/**
* @return bool|null
*/
public function getCanSendOtherMessages()
{
return $this->canSendOtherMessages;
}
/**
* @param bool $canSendOtherMessages
* @return void
*/
public function setCanSendOtherMessages($canSendOtherMessages)
{
$this->canSendOtherMessages = $canSendOtherMessages;
}
/**
* @return bool|null
*/
public function getCanAddWebPagePreviews()
{
return $this->canAddWebPagePreviews;
}
/**
* @param bool $canAddWebPagePreviews
* @return void
*/
public function setCanAddWebPagePreviews($canAddWebPagePreviews)
{
$this->canAddWebPagePreviews = $canAddWebPagePreviews;
}
/**
* @return bool
*/
public function getCanManageChat()
{
return $this->canManageChat;
}
/**
* @param bool $canManageChat
* @return void
*/
public function setCanManageChat($canManageChat)
{
$this->canManageChat = $canManageChat;
}
/**
* @return bool
*/
public function getIsAnonymous()
{
return $this->isAnonymous;
}
/**
* @param bool $isAnonymous
* @return void
*/
public function setIsAnonymous($isAnonymous)
{
$this->isAnonymous = $isAnonymous;
}
/**
* @return bool
*/
public function getCanSendPolls()
{
return $this->canSendPolls;
}
/**
* @param bool $canSendPolls
* @return void
*/
public function setCanSendPolls($canSendPolls)
{
$this->canSendPolls = $canSendPolls;
}
/**
* @return bool|null
*/
public function getCanManageTopics()
{
return $this->canManageTopics;
}
/**
* @param bool $canManageTopics
* @return void
*/
public function setCanManageTopics($canManageTopics)
{
$this->canManageTopics = $canManageTopics;
}
/**
* @return null|string
*/
public function getCustomTitle()
{
return $this->customTitle;
}
/**
* @param string $customTitle
* @return void
*/
public function setCustomTitle($customTitle)
{
$this->customTitle = $customTitle;
}
}

View File

@@ -0,0 +1,228 @@
<?php
namespace TelegramBot\Api\Types;
use TelegramBot\Api\BaseType;
use TelegramBot\Api\TypeInterface;
class ChatPermissions extends BaseType implements TypeInterface
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = [];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'can_send_messages' => true,
'can_send_media_messages' => true,
'can_send_polls' => true,
'can_send_other_messages' => true,
'can_add_web_page_previews' => true,
'can_change_info' => true,
'can_invite_users' => true,
'can_pin_messages' => true,
];
/**
* Optional. True, if the user is allowed to send text messages, contacts, locations and venues
*
* @var bool|null
*/
protected $canSendMessages;
/**
* Optional. True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes,
* implies can_send_messages
*
* @var bool|null
*/
protected $canSendMediaMessages;
/**
* Optional. True, if the user is allowed to send polls, implies can_send_messages
*
* @var bool|null
*/
protected $canSendPolls;
/**
* Optional. True, if the user is allowed to send animations, games, stickers and use inline bots, implies
* can_send_media_messages
*
* @var bool|null
*/
protected $canSendOtherMessages;
/**
* Optional. True, if the user is allowed to add web page previews to their messages, implies
* can_send_media_messages
*
* @var bool|null
*/
protected $canAddWebPagePreviews;
/**
* Optional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public
* supergroups
*
* @var bool|null
*/
protected $canChangeInfo;
/**
* Optional. True, if the user is allowed to invite new users to the chat
*
* @var bool|null
*/
protected $canInviteUsers;
/**
* Optional. True, if the user is allowed to pin messages. Ignored in public supergroups
*
* @var bool|null
*/
protected $canPinMessages;
/**
* @return bool|null
*/
public function isCanSendMessages()
{
return $this->canSendMessages;
}
/**
* @param bool $canSendMessages
* @return void
*/
public function setCanSendMessages($canSendMessages)
{
$this->canSendMessages = $canSendMessages;
}
/**
* @return bool|null
*/
public function isCanSendMediaMessages()
{
return $this->canSendMediaMessages;
}
/**
* @param bool $canSendMediaMessages
* @return void
*/
public function setCanSendMediaMessages($canSendMediaMessages)
{
$this->canSendMediaMessages = $canSendMediaMessages;
}
/**
* @return bool|null
*/
public function isCanSendPolls()
{
return $this->canSendPolls;
}
/**
* @param bool $canSendPolls
* @return void
*/
public function setCanSendPolls($canSendPolls)
{
$this->canSendPolls = $canSendPolls;
}
/**
* @return bool|null
*/
public function isCanSendOtherMessages()
{
return $this->canSendOtherMessages;
}
/**
* @param bool $canSendOtherMessages
* @return void
*/
public function setCanSendOtherMessages($canSendOtherMessages)
{
$this->canSendOtherMessages = $canSendOtherMessages;
}
/**
* @return bool|null
*/
public function isCanAddWebPagePreviews()
{
return $this->canAddWebPagePreviews;
}
/**
* @param bool $canAddWebPagePreviews
* @return void
*/
public function setCanAddWebPagePreviews($canAddWebPagePreviews)
{
$this->canAddWebPagePreviews = $canAddWebPagePreviews;
}
/**
* @return bool|null
*/
public function isCanChangeInfo()
{
return $this->canChangeInfo;
}
/**
* @param bool $canChangeInfo
* @return void
*/
public function setCanChangeInfo($canChangeInfo)
{
$this->canChangeInfo = $canChangeInfo;
}
/**
* @return bool|null
*/
public function isCanInviteUsers()
{
return $this->canInviteUsers;
}
/**
* @param bool $canInviteUsers
* @return void
*/
public function setCanInviteUsers($canInviteUsers)
{
$this->canInviteUsers = $canInviteUsers;
}
/**
* @return bool|null
*/
public function isCanPinMessages()
{
return $this->canPinMessages;
}
/**
* @param bool $canPinMessages
* @return void
*/
public function setCanPinMessages($canPinMessages)
{
$this->canPinMessages = $canPinMessages;
}
}

View File

@@ -0,0 +1,73 @@
<?php
namespace TelegramBot\Api\Types;
use TelegramBot\Api\BaseType;
class ChatPhoto extends BaseType
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['small_file_id', 'big_file_id'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'small_file_id' => true,
'big_file_id' => true,
];
/**
* Unique file identifier of small (160x160) chat photo. This file_id can be used only for photo download.
*
* @var string
*/
protected $smallFileId;
/**
* Unique file identifier of big (640x640) chat photo. This file_id can be used only for photo download.
*
* @var string
*/
protected $bigFileId;
/**
* @return string
*/
public function getSmallFileId()
{
return $this->smallFileId;
}
/**
* @param string $smallFileId
* @return void
*/
public function setSmallFileId($smallFileId)
{
$this->smallFileId = $smallFileId;
}
/**
* @return string
*/
public function getBigFileId()
{
return $this->bigFileId;
}
/**
* @param string $bigFileId
* @return void
*/
public function setBigFileId($bigFileId)
{
$this->bigFileId = $bigFileId;
}
}

155
vendor/telegram-bot/api/src/Types/Contact.php vendored Executable file
View File

@@ -0,0 +1,155 @@
<?php
namespace TelegramBot\Api\Types;
use TelegramBot\Api\BaseType;
use TelegramBot\Api\TypeInterface;
/**
* Class Contact
* This object represents a phone contact.
*
* @package TelegramBot\Api\Types
*/
class Contact extends BaseType implements TypeInterface
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['phone_number', 'first_name'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'phone_number' => true,
'first_name' => true,
'last_name' => true,
'user_id' => true,
'vcard' => true,
];
/**
* Contact's phone number
*
* @var string
*/
protected $phoneNumber;
/**
* Contact's first name
*
* @var string
*/
protected $firstName;
/**
* Optional. Contact's last name
*
* @var string|null
*/
protected $lastName;
/**
* Optional. Contact's user identifier in Telegram
*
* @var int|null
*/
protected $userId;
/**
* Optional. Additional data about the contact in the form of a vCard
*
* @var string|null
*/
protected $vcard;
/**
* @return string
*/
public function getFirstName()
{
return $this->firstName;
}
/**
* @param string $firstName
* @return void
*/
public function setFirstName($firstName)
{
$this->firstName = $firstName;
}
/**
* @return null|string
*/
public function getLastName()
{
return $this->lastName;
}
/**
* @param string $lastName
* @return void
*/
public function setLastName($lastName)
{
$this->lastName = $lastName;
}
/**
* @return string
*/
public function getPhoneNumber()
{
return $this->phoneNumber;
}
/**
* @param string $phoneNumber
* @return void
*/
public function setPhoneNumber($phoneNumber)
{
$this->phoneNumber = $phoneNumber;
}
/**
* @return int|null
*/
public function getUserId()
{
return $this->userId;
}
/**
* @param int $userId
* @return void
*/
public function setUserId($userId)
{
$this->userId = $userId;
}
/**
* @return null|string
*/
public function getVCard()
{
return $this->vcard;
}
/**
* @param string $vcard
* @return void
*/
public function setVCard($vcard)
{
$this->vcard = $vcard;
}
}

78
vendor/telegram-bot/api/src/Types/Dice.php vendored Executable file
View File

@@ -0,0 +1,78 @@
<?php
namespace TelegramBot\Api\Types;
use TelegramBot\Api\BaseType;
use TelegramBot\Api\TypeInterface;
/**
* Class Dice
* This object represents an animated emoji that displays a random value.
*/
class Dice extends BaseType implements TypeInterface
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['emoji', 'value'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'emoji' => true,
'value' => true
];
/**
* Emoji on which the dice throw animation is based
*
* @var string
*/
protected $emoji;
/**
* Value of the dice, 1-6 for “🎲” and “🎯” base emoji, 1-5 for “🏀” and “⚽” base emoji, 1-64 for “🎰” base emoji
*
* @var int
*/
protected $value;
/**
* @return string
*/
public function getEmoji()
{
return $this->emoji;
}
/**
* @param string $emoji
* @return void
*/
public function setEmoji($emoji)
{
$this->emoji = $emoji;
}
/**
* @return int
*/
public function getValue()
{
return $this->value;
}
/**
* @param int $value
* @return void
*/
public function setValue($value)
{
$this->value = $value;
}
}

209
vendor/telegram-bot/api/src/Types/Document.php vendored Executable file
View File

@@ -0,0 +1,209 @@
<?php
namespace TelegramBot\Api\Types;
use TelegramBot\Api\BaseType;
use TelegramBot\Api\InvalidArgumentException;
use TelegramBot\Api\TypeInterface;
/**
* Class Document
* This object represents a general file (as opposed to photos and audio files).
* Telegram users can send files of any type of up to 1.5 GB in size.
*
* @package TelegramBot\Api\Types
*/
class Document extends BaseType implements TypeInterface
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'file_id' => true,
'file_unique_id' => true,
'thumbnail' => PhotoSize::class,
'file_name' => true,
'mime_type' => true,
'file_size' => true
];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['file_id', 'file_unique_id'];
/**
* Unique identifier for this file
*
* @var string
*/
protected $fileId;
/**
* Document thumbnail as defined by sender
*
* @var PhotoSize
*/
protected $thumbnail;
/**
* Optional. Original filename as defined by sender
*
* @var string|null
*/
protected $fileName;
/**
* Optional. MIME type of the file as defined by sender
*
* @var string|null
*/
protected $mimeType;
/**
* Optional. File size
*
* @var int|null
*/
protected $fileSize;
/**
* Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
*
* @var string
*/
protected $fileUniqueId;
/**
* @return string
*/
public function getFileId()
{
return $this->fileId;
}
/**
* @param string $fileId
* @return void
*/
public function setFileId($fileId)
{
$this->fileId = $fileId;
}
/**
* @return null|string
*/
public function getFileName()
{
return $this->fileName;
}
/**
* @param string $fileName
* @return void
*/
public function setFileName($fileName)
{
$this->fileName = $fileName;
}
/**
* @return int|null
*/
public function getFileSize()
{
return $this->fileSize;
}
/**
* @param mixed $fileSize
* @return void
* @throws InvalidArgumentException
*/
public function setFileSize($fileSize)
{
if (is_integer($fileSize)) {
$this->fileSize = $fileSize;
} else {
throw new InvalidArgumentException();
}
}
/**
* @return null|string
*/
public function getMimeType()
{
return $this->mimeType;
}
/**
* @param string $mimeType
* @return void
*/
public function setMimeType($mimeType)
{
$this->mimeType = $mimeType;
}
/**
* @return PhotoSize
*/
public function getThumbnail()
{
return $this->thumbnail;
}
/**
* @param PhotoSize $thumbnail
* @return void
*/
public function setThumbnail(PhotoSize $thumbnail)
{
$this->thumbnail = $thumbnail;
}
/**
* @deprecated use getThumbnail method
*
* @return PhotoSize|null
*/
public function getThumb()
{
return $this->getThumbnail();
}
/**
* @deprecated use setThumbnail method
*
* @param PhotoSize $thumb
*
* @return void
*/
public function setThumb($thumb)
{
$this->setThumbnail($thumb);
}
/**
* @return string
*/
public function getFileUniqueId()
{
return $this->fileUniqueId;
}
/**
* @param string $fileUniqueId
* @return void
*/
public function setFileUniqueId($fileUniqueId)
{
$this->fileUniqueId = $fileUniqueId;
}
}

139
vendor/telegram-bot/api/src/Types/File.php vendored Executable file
View File

@@ -0,0 +1,139 @@
<?php
namespace TelegramBot\Api\Types;
use TelegramBot\Api\BaseType;
use TelegramBot\Api\InvalidArgumentException;
use TelegramBot\Api\TypeInterface;
/**
* Class File
* This object represents a file ready to be downloaded.
* The file can be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>.
* It is guaranteed that the link will be valid for at least 1 hour.
* When the link expires, a new one can be requested by calling getFile.
*
* @package TelegramBot\Api\Types
*/
class File extends BaseType implements TypeInterface
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['file_id'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'file_id' => true,
'file_unique_id' => true,
'file_size' => true,
'file_path' => true
];
/**
* Unique identifier for this file
*
* @var string
*/
protected $fileId;
/**
* Optional. File size, if known
*
* @var int|null
*/
protected $fileSize;
/**
* Optional. File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file.
*
* @var string|null
*/
protected $filePath;
/**
* Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
*
* @var string
*/
protected $fileUniqueId;
/**
* @return string
*/
public function getFileId()
{
return $this->fileId;
}
/**
* @param string $fileId
* @return void
*/
public function setFileId($fileId)
{
$this->fileId = $fileId;
}
/**
* @return int|null
*/
public function getFileSize()
{
return $this->fileSize;
}
/**
* @param mixed $fileSize
* @return void
* @throws InvalidArgumentException
*/
public function setFileSize($fileSize)
{
if (is_integer($fileSize)) {
$this->fileSize = $fileSize;
} else {
throw new InvalidArgumentException();
}
}
/**
* @return null|string
*/
public function getFilePath()
{
return $this->filePath;
}
/**
* @param string $filePath
* @return void
*/
public function setFilePath($filePath)
{
$this->filePath = $filePath;
}
/**
* @return string
*/
public function getFileUniqueId()
{
return $this->fileUniqueId;
}
/**
* @param string $fileUniqueId
* @return void
*/
public function setFileUniqueId($fileUniqueId)
{
$this->fileUniqueId = $fileUniqueId;
}
}

View File

@@ -0,0 +1,121 @@
<?php
namespace TelegramBot\Api\Types;
use TelegramBot\Api\BaseType;
/**
* Class ForceReply
* Upon receiving a message with this object, Telegram clients will display a reply interface to the user
* (act as if the user has selected the bots message and tapped Reply').This can be extremely useful
* if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode.
*
* @package TelegramBot\Api\Types
*/
class ForceReply extends BaseType
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['force_reply'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'force_reply' => true,
'input_field_placeholder' => true,
'selective' => true
];
/**
* Shows reply interface to the user, as if they manually selected the bots message and tapped Reply'
*
* @var bool
*/
protected $forceReply;
/**
* The placeholder to be shown in the input field when the reply is active; 1-64 characters
*
* @var string|null
*/
protected $inputFieldPlaceholder;
/**
* Optional. Use this parameter if you want to show the keyboard to specific users only.
* Targets:
* 1) users that are @mentioned in the text of the Message object;
* 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.
*
* @var bool|null
*/
protected $selective;
/**
* @param bool $forceReply
* @param bool|null $selective
* @param string|null $inputFieldPlaceholder
*/
public function __construct($forceReply = true, $selective = null, $inputFieldPlaceholder = null)
{
$this->forceReply = $forceReply;
$this->selective = $selective;
$this->inputFieldPlaceholder = $inputFieldPlaceholder;
}
/**
* @return bool
*/
public function isForceReply()
{
return $this->forceReply;
}
/**
* @param bool $forceReply
* @return void
*/
public function setForceReply($forceReply)
{
$this->forceReply = $forceReply;
}
/**
* @return bool|null
*/
public function isSelective()
{
return $this->selective;
}
/**
* @param bool|null $selective
* @return void
*/
public function setSelective($selective)
{
$this->selective = $selective;
}
/**
* @param string|null $inputFieldPlaceholder
* @return void
*/
public function setInputFieldPlaceholder($inputFieldPlaceholder)
{
$this->inputFieldPlaceholder = $inputFieldPlaceholder;
}
/**
* @return string|null
*/
public function getInputFieldPlaceholder()
{
return $this->inputFieldPlaceholder;
}
}

View File

@@ -0,0 +1,131 @@
<?php
namespace TelegramBot\Api\Types;
use TelegramBot\Api\BaseType;
use TelegramBot\Api\TypeInterface;
/**
* Class ForumTopic
* This object represents a forum topic.
*
* @package TelegramBot\Api\Types
* @author bernard-ng <bernard@devscast.tech>
*/
class ForumTopic extends BaseType implements TypeInterface
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['message_thread_id', 'name', 'icon_color'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'message_thread_id' => true,
'name' => true,
'icon_color' => true,
'icon_custom_emoji_id' => true,
];
/**
* Unique identifier of the forum topic
*
* @var int
*/
protected $messageThreadId;
/**
* Name of the topic
*
* @var string
*/
protected $name;
/**
* Color of the topic icon in RGB format
*
* @var int
*/
protected $iconColor;
/**
* Optional. Unique identifier of the custom emoji shown as the topic icon
*
* @var string|null
*/
protected $iconCustomEmojiId;
/**
* @return int
*/
public function getMessageThreadId()
{
return $this->messageThreadId;
}
/**
* @param int $messageThreadId
* @return void
*/
public function setMessageThreadId($messageThreadId)
{
$this->messageThreadId = $messageThreadId;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* @param string $name
* @return void
*/
public function setName($name)
{
$this->name = $name;
}
/**
* @return int
*/
public function getIconColor()
{
return $this->iconColor;
}
/**
* @param int $iconColor
* @return void
*/
public function setIconColor($iconColor)
{
$this->iconColor = $iconColor;
}
/**
* @return null|string
*/
public function getIconCustomEmojiId()
{
return $this->iconCustomEmojiId;
}
/**
* @param string $iconCustomEmojiId
* @return void
*/
public function setIconCustomEmojiId($iconCustomEmojiId)
{
$this->iconCustomEmojiId = $iconCustomEmojiId;
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace TelegramBot\Api\Types;
use TelegramBot\Api\BaseType;
use TelegramBot\Api\TypeInterface;
/**
* Class ForumTopicClosed
* This object represents a service message about a forum topic closed in the chat. Currently holds no information.
*
* @package TelegramBot\Api\Types
* @author bernard-ng <bernard@devscast.tech>
*/
class ForumTopicClosed extends BaseType implements TypeInterface
{
}

View File

@@ -0,0 +1,106 @@
<?php
namespace TelegramBot\Api\Types;
use TelegramBot\Api\BaseType;
use TelegramBot\Api\TypeInterface;
/**
* class ForumTopicCreated.
* This object represents a service message about a new forum topic created in the chat.
*
* @package TelegramBot\Api\Types
* @author bernard-ng <bernard@devscast.tech>
*/
class ForumTopicCreated extends BaseType implements TypeInterface
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['name', 'icon_color'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'name' => true,
'icon_color' => true,
'icon_custom_emoji_id' => true,
];
/**
* Name of the forum topic
*
* @var string
*/
protected $name;
/**
* Color of the forum topic
*
* @var string
*/
protected $iconColor;
/**
* Custom emoji of the forum topic
*
* @var string
*/
protected $iconCustomEmojiId;
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* @param string $name
* @return void
*/
public function setName($name)
{
$this->name = $name;
}
/**
* @return string
*/
public function getIconColor()
{
return $this->iconColor;
}
/**
* @param string $iconColor
* @return void
*/
public function setIconColor($iconColor)
{
$this->iconColor = $iconColor;
}
/**
* @return string
*/
public function getIconCustomEmojiId()
{
return $this->iconCustomEmojiId;
}
/**
* @param string $iconCustomEmojiId
* @return void
*/
public function setIconCustomEmojiId($iconCustomEmojiId)
{
$this->iconCustomEmojiId = $iconCustomEmojiId;
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace TelegramBot\Api\Types;
use TelegramBot\Api\BaseType;
use TelegramBot\Api\TypeInterface;
/**
* Class ForumTopicReopened
* This object represents a service message about a forum topic reopened in the chat. Currently holds no information.
*
* @package TelegramBot\Api\Types
* @author bernard-ng <bernard@devscast.tech>
*/
class ForumTopicReopened extends BaseType implements TypeInterface
{
}

View File

@@ -0,0 +1,163 @@
<?php
namespace TelegramBot\Api\Types\Inline;
use TelegramBot\Api\BaseType;
use TelegramBot\Api\Types\Location;
use TelegramBot\Api\Types\User;
/**
* Class ChosenInlineResult
* This object represents a result of an inline query that was chosen by the user and sent to their chat partner.
*
* @package TelegramBot\Api\Types
*/
class ChosenInlineResult extends BaseType
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['result_id', 'from', 'query'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'result_id' => true,
'from' => User::class,
'location' => Location::class,
'inline_message_id' => true,
'query' => true,
];
/**
* The unique identifier for the result that was chosen.
*
* @var string
*/
protected $resultId;
/**
* The user that chose the result.
*
* @var User
*/
protected $from;
/**
* Optional. Sender location, only for bots that require user location
*
* @var Location|null
*/
protected $location;
/**
* Optional. Identifier of the sent inline message.
* Available only if there is an inline keyboard attached to the message.
* Will be also received in callback queries and can be used to edit the message.
*
* @var string|null
*/
protected $inlineMessageId;
/**
* The query that was used to obtain the result.
*
* @var string
*/
protected $query;
/**
* @return string
*/
public function getResultId()
{
return $this->resultId;
}
/**
* @param string $resultId
*
* @return void
*/
public function setResultId($resultId)
{
$this->resultId = $resultId;
}
/**
* @return User
*/
public function getFrom()
{
return $this->from;
}
/**
* @param User $from
*
* @return void
*/
public function setFrom(User $from)
{
$this->from = $from;
}
/**
* @return Location|null
*/
public function getLocation()
{
return $this->location;
}
/**
* @param Location $location
*
* @return void
*/
public function setLocation($location)
{
$this->location = $location;
}
/**
* @return null|string
*/
public function getInlineMessageId()
{
return $this->inlineMessageId;
}
/**
* @param string $inlineMessageId
*
* @return void
*/
public function setInlineMessageId($inlineMessageId)
{
$this->inlineMessageId = $inlineMessageId;
}
/**
* @return string
*/
public function getQuery()
{
return $this->query;
}
/**
* @param string $query
*
* @return void
*/
public function setQuery($query)
{
$this->query = $query;
}
}

View File

@@ -0,0 +1,64 @@
<?php
/**
* Created by PhpStorm.
* User: YaroslavMolchan
* Date: 16/03/17
* Time: 22:15
*/
namespace TelegramBot\Api\Types\Inline;
use TelegramBot\Api\BaseType;
class InlineKeyboardMarkup extends BaseType
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['inline_keyboard'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'inline_keyboard' => true,
];
/**
* Array of button rows, each represented by an Array of InlineKeyboardButton objects
* Array of Array of InlineKeyboardButton
*
* @var array
*/
protected $inlineKeyboard;
/**
* @param array $inlineKeyboard
*/
public function __construct($inlineKeyboard = [])
{
$this->inlineKeyboard = $inlineKeyboard;
}
/**
* @return array
*/
public function getInlineKeyboard()
{
return $this->inlineKeyboard;
}
/**
* @param array $inlineKeyboard
*
* @return void
*/
public function setInlineKeyboard($inlineKeyboard)
{
$this->inlineKeyboard = $inlineKeyboard;
}
}

View File

@@ -0,0 +1,162 @@
<?php
namespace TelegramBot\Api\Types\Inline;
use TelegramBot\Api\BaseType;
use TelegramBot\Api\Types\Location;
use TelegramBot\Api\Types\User;
/**
* Class InlineQuery
* This object represents an incoming inline query.
* When the user sends an empty query, your bot could return some default or trending results.
*
* @package TelegramBot\Api\Types
*/
class InlineQuery extends BaseType
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['id', 'from', 'query', 'offset'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'id' => true,
'from' => User::class,
'location' => Location::class,
'query' => true,
'offset' => true,
];
/**
* Unique identifier for this query
*
* @var string
*/
protected $id;
/**
* Sender
*
* @var User
*/
protected $from;
/**
* Optional. Sender location, only for bots that request user location
*
* @var Location|null
*/
protected $location;
/**
* Text of the query
*
* @var string
*/
protected $query;
/**
* Offset of the results to be returned, can be controlled by the bot
*
* @var string
*/
protected $offset;
/**
* @return string
*/
public function getId()
{
return $this->id;
}
/**
* @param string $id
*
* @return void
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @return User
*/
public function getFrom()
{
return $this->from;
}
/**
* @param User $from
*
* @return void
*/
public function setFrom(User $from)
{
$this->from = $from;
}
/**
* @return Location|null
*/
public function getLocation()
{
return $this->location;
}
/**
* @param Location $location
*
* @return void
*/
public function setLocation($location)
{
$this->location = $location;
}
/**
* @return string
*/
public function getQuery()
{
return $this->query;
}
/**
* @param string $query
*
* @return void
*/
public function setQuery($query)
{
$this->query = $query;
}
/**
* @return string
*/
public function getOffset()
{
return $this->offset;
}
/**
* @param string $offset
*
* @return void
*/
public function setOffset($offset)
{
$this->offset = $offset;
}
}

View File

@@ -0,0 +1,15 @@
<?php
/**
* Created by PhpStorm.
* User: iGusev
* Date: 14/04/16
* Time: 04:05
*/
namespace TelegramBot\Api\Types\Inline;
use TelegramBot\Api\BaseType;
class InputMessageContent extends BaseType
{
}

View File

@@ -0,0 +1,130 @@
<?php
/**
* Created by PhpStorm.
* User: iGusev
* Date: 14/04/16
* Time: 16:01
*/
namespace TelegramBot\Api\Types\Inline\InputMessageContent;
use TelegramBot\Api\TypeInterface;
use TelegramBot\Api\Types\Inline\InputMessageContent;
/**
* Class Contact
*
* @see https://core.telegram.org/bots/api#inputcontactmessagecontent
* Represents the content of a contact message to be sent as the result of an inline query.
*
* @package TelegramBot\Api\Types\Inline
*/
class Contact extends InputMessageContent implements TypeInterface
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['phone_number', 'first_name'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'phone_number' => true,
'first_name' => true,
'last_name' => true,
];
/**
* Contact's phone number
*
* @var string
*/
protected $phoneNumber;
/**
* Contact's first name
*
* @var string
*/
protected $firstName;
/**
* Optional. Contact's last name
*
* @var string|null
*/
protected $lastName;
/**
* Contact constructor.
*
* @param string $phoneNumber
* @param string $firstName
* @param string|null $lastName
*/
public function __construct($phoneNumber, $firstName, $lastName = null)
{
$this->phoneNumber = $phoneNumber;
$this->firstName = $firstName;
$this->lastName = $lastName;
}
/**
* @return string
*/
public function getPhoneNumber()
{
return $this->phoneNumber;
}
/**
* @param string $phoneNumber
*
* @return void
*/
public function setPhoneNumber($phoneNumber)
{
$this->phoneNumber = $phoneNumber;
}
/**
* @return mixed
*/
public function getFirstName()
{
return $this->firstName;
}
/**
* @param mixed $firstName
*
* @return void
*/
public function setFirstName($firstName)
{
$this->firstName = $firstName;
}
/**
* @return string|null
*/
public function getLastName()
{
return $this->lastName;
}
/**
* @param string|null $lastName
*
* @return void
*/
public function setLastName($lastName)
{
$this->lastName = $lastName;
}
}

View File

@@ -0,0 +1,100 @@
<?php
/**
* Created by PhpStorm.
* User: iGusev
* Date: 14/04/16
* Time: 15:41
*/
namespace TelegramBot\Api\Types\Inline\InputMessageContent;
use TelegramBot\Api\TypeInterface;
use TelegramBot\Api\Types\Inline\InputMessageContent;
/**
* Class Location
* @see https://core.telegram.org/bots/api#inputlocationmessagecontent
* Represents the content of a location message to be sent as the result of an inline query.
*
* @package TelegramBot\Api\Types\Inline
*/
class Location extends InputMessageContent implements TypeInterface
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['latitude', 'longitude'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'latitude' => true,
'longitude' => true
];
/**
* Latitude of the location in degrees
*
* @var float
*/
protected $latitude;
/**
* Longitude of the location in degrees
*
* @var float
*/
protected $longitude;
/**
* Location constructor.
* @param float $latitude
* @param float $longitude
*/
public function __construct($latitude, $longitude)
{
$this->latitude = $latitude;
$this->longitude = $longitude;
}
/**
* @return float
*/
public function getLatitude()
{
return $this->latitude;
}
/**
* @param float $latitude
*
* @return void
*/
public function setLatitude($latitude)
{
$this->latitude = $latitude;
}
/**
* @return float
*/
public function getLongitude()
{
return $this->longitude;
}
/**
* @param float $longitude
*
* @return void
*/
public function setLongitude($longitude)
{
$this->longitude = $longitude;
}
}

View File

@@ -0,0 +1,129 @@
<?php
/**
* Created by PhpStorm.
* User: iGusev
* Date: 14/04/16
* Time: 14:41
*/
namespace TelegramBot\Api\Types\Inline\InputMessageContent;
use TelegramBot\Api\TypeInterface;
use TelegramBot\Api\Types\Inline\InputMessageContent;
/**
* Class Text
* @see https://core.telegram.org/bots/api#inputtextmessagecontent
* Represents the content of a text message to be sent as the result of an inline query.
*
* @package TelegramBot\Api\Types\Inline\InputMessageContent
*/
class Text extends InputMessageContent implements TypeInterface
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['message_text'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'message_text' => true,
'parse_mode' => true,
'disable_web_page_preview' => true,
];
/**
* Text of the message to be sent, 1-4096 characters
*
* @var string
*/
protected $messageText;
/**
* Optional. Send Markdown or HTML,
* if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message.
*
* @var string|null
*/
protected $parseMode;
/**
* Optional. Disables link previews for links in the sent message
*
* @var bool|null
*/
protected $disableWebPagePreview;
/**
* Text constructor.
* @param string $messageText
* @param string|null $parseMode
* @param bool $disableWebPagePreview
*/
public function __construct($messageText, $parseMode = null, $disableWebPagePreview = false)
{
$this->messageText = $messageText;
$this->parseMode = $parseMode;
$this->disableWebPagePreview = $disableWebPagePreview;
}
/**
* @return string
*/
public function getMessageText()
{
return $this->messageText;
}
/**
* @param string $messageText
*
* @return void
*/
public function setMessageText($messageText)
{
$this->messageText = $messageText;
}
/**
* @return string|null
*/
public function getParseMode()
{
return $this->parseMode;
}
/**
* @param string|null $parseMode
*
* @return void
*/
public function setParseMode($parseMode)
{
$this->parseMode = $parseMode;
}
/**
* @return bool|null
*/
public function isDisableWebPagePreview()
{
return $this->disableWebPagePreview;
}
/**
* @param bool|null $disableWebPagePreview
*
* @return void
*/
public function setDisableWebPagePreview($disableWebPagePreview)
{
$this->disableWebPagePreview = $disableWebPagePreview;
}
}

View File

@@ -0,0 +1,184 @@
<?php
/**
* Created by PhpStorm.
* User: iGusev
* Date: 14/04/16
* Time: 15:45
*/
namespace TelegramBot\Api\Types\Inline\InputMessageContent;
use TelegramBot\Api\TypeInterface;
use TelegramBot\Api\Types\Inline\InputMessageContent;
/**
* Class Venue
* @see https://core.telegram.org/bots/api#inputvenuemessagecontent
* Represents the content of a venue message to be sent as the result of an inline query.
*
* @package TelegramBot\Api\Types\Inline
*/
class Venue extends InputMessageContent implements TypeInterface
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['latitude', 'longitude', 'title', 'address'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'latitude' => true,
'longitude' => true,
'title' => true,
'address' => true,
'foursquare_id' => true
];
/**
* Latitude of the venue in degrees
*
* @var float
*/
protected $latitude;
/**
* Longitude of the venue in degrees
*
* @var float
*/
protected $longitude;
/**
* Name of the venue
*
* @var string
*/
protected $title;
/**
* Address of the venue
*
* @var string
*/
protected $address;
/**
* Optional. Foursquare identifier of the venue, if known
*
* @var string|null
*/
protected $foursquareId;
/**
* Venue constructor.
* @param float $latitude
* @param float $longitude
* @param string $title
* @param string $address
* @param string|null $foursquareId
*/
public function __construct($latitude, $longitude, $title, $address, $foursquareId = null)
{
$this->latitude = $latitude;
$this->longitude = $longitude;
$this->title = $title;
$this->address = $address;
$this->foursquareId = $foursquareId;
}
/**
* @return float
*/
public function getLatitude()
{
return $this->latitude;
}
/**
* @param float $latitude
*
* @return void
*/
public function setLatitude($latitude)
{
$this->latitude = $latitude;
}
/**
* @return float
*/
public function getLongitude()
{
return $this->longitude;
}
/**
* @param float $longitude
*
* @return void
*/
public function setLongitude($longitude)
{
$this->longitude = $longitude;
}
/**
* @return string
*/
public function getTitle()
{
return $this->title;
}
/**
* @param string $title
*
* @return void
*/
public function setTitle($title)
{
$this->title = $title;
}
/**
* @return string
*/
public function getAddress()
{
return $this->address;
}
/**
* @param string $address
*
* @return void
*/
public function setAddress($address)
{
$this->address = $address;
}
/**
* @return string|null
*/
public function getFoursquareId()
{
return $this->foursquareId;
}
/**
* @param string|null $foursquareId
*
* @return void
*/
public function setFoursquareId($foursquareId)
{
$this->foursquareId = $foursquareId;
}
}

View File

@@ -0,0 +1,157 @@
<?php
namespace TelegramBot\Api\Types\Inline\QueryResult;
use TelegramBot\Api\BaseType;
use TelegramBot\Api\Types\Inline\InlineKeyboardMarkup;
use TelegramBot\Api\Types\Inline\InputMessageContent;
/**
* Class AbstractInlineQueryResult
* Abstract class for representing one result of an inline query
*
* @package TelegramBot\Api\Types
*/
class AbstractInlineQueryResult extends BaseType
{
/**
* Type of the result, must be one of: article, photo, gif, mpeg4_gif, video
*
* @var string
*/
protected $type;
/**
* Unique identifier for this result, 1-64 bytes
*
* @var string
*/
protected $id;
/**
* Title for the result
*
* @var string|null
*/
protected $title;
/**
* Content of the message to be sent instead of the file
*
* @var InputMessageContent|null
*/
protected $inputMessageContent;
/**
* Optional. Inline keyboard attached to the message
*
* @var InlineKeyboardMarkup|null
*/
protected $replyMarkup;
/**
* AbstractInlineQueryResult constructor.
*
* @param string $id
* @param string|null $title
* @param InputMessageContent|null $inputMessageContent
* @param InlineKeyboardMarkup|null $replyMarkup
*/
public function __construct($id, $title = null, $inputMessageContent = null, $replyMarkup = null)
{
$this->id = $id;
$this->title = $title;
$this->inputMessageContent = $inputMessageContent;
$this->replyMarkup = $replyMarkup;
}
/**
* @return string
*/
public function getType()
{
return $this->type;
}
/**
* @param string $type
*
* @return void
*/
public function setType($type)
{
$this->type = $type;
}
/**
* @return string
*/
public function getId()
{
return $this->id;
}
/**
* @param string $id
*
* @return void
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @return string|null
*/
public function getTitle()
{
return $this->title;
}
/**
* @param string|null $title
*
* @return void
*/
public function setTitle($title)
{
$this->title = $title;
}
/**
* @return InputMessageContent|null
*/
public function getInputMessageContent()
{
return $this->inputMessageContent;
}
/**
* @param InputMessageContent|null $inputMessageContent
*
* @return void
*/
public function setInputMessageContent($inputMessageContent)
{
$this->inputMessageContent = $inputMessageContent;
}
/**
* @return InlineKeyboardMarkup|null
*/
public function getReplyMarkup()
{
return $this->replyMarkup;
}
/**
* @param InlineKeyboardMarkup|null $replyMarkup
*
* @return void
*/
public function setReplyMarkup($replyMarkup)
{
$this->replyMarkup = $replyMarkup;
}
}

View File

@@ -0,0 +1,294 @@
<?php
namespace TelegramBot\Api\Types\Inline\QueryResult;
use TelegramBot\Api\Types\Inline\InlineKeyboardMarkup;
use TelegramBot\Api\Types\Inline\InputMessageContent;
/**
* Class InlineQueryResultArticle
* Represents a link to an article or web page.
*
* @package TelegramBot\Api\Types\Inline
*/
class Article extends AbstractInlineQueryResult
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['type', 'id', 'title', 'input_message_content'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'type' => true,
'id' => true,
'title' => true,
'input_message_content' => InputMessageContent::class,
'reply_markup' => InlineKeyboardMarkup::class,
'url' => true,
'hide_url' => true,
'description' => true,
'thumbnail_url' => true,
'thumbnail_width' => true,
'thumbnail_height' => true,
];
/**
* {@inheritdoc}
*
* @var string
*/
protected $type = 'article';
/**
* Optional. URL of the result
*
* @var string|null
*/
protected $url;
/**
* Optional. Pass True, if you don't want the URL to be shown in the message
*
* @var bool|null
*/
protected $hideUrl;
/**
* Optional. Short description of the result
*
* @var string|null
*/
protected $description;
/**
* Optional. Url of the thumbnail for the result
*
* @var string|null
*/
protected $thumbnailUrl;
/**
* Optional. Thumbnail width
*
* @var int|null
*/
protected $thumbnailWidth;
/**
* Optional. Thumbnail height
*
* @var int|null
*/
protected $thumbnailHeight;
/**
* InlineQueryResultArticle constructor.
*
* @param string $id
* @param string $title
* @param string|null $description
* @param string|null $thumbnailUrl
* @param int|null $thumbnailWidth
* @param int|null $thumbnailHeight
* @param InputMessageContent $inputMessageContent
* @param InlineKeyboardMarkup|null $inlineKeyboardMarkup
*/
public function __construct(
$id,
$title,
$description = null,
$thumbnailUrl = null,
$thumbnailWidth = null,
$thumbnailHeight = null,
$inputMessageContent = null,
$inlineKeyboardMarkup = null
) {
parent::__construct($id, $title, $inputMessageContent, $inlineKeyboardMarkup);
$this->description = $description;
$this->thumbnailUrl = $thumbnailUrl;
$this->thumbnailWidth = $thumbnailWidth;
$this->thumbnailHeight = $thumbnailHeight;
}
/**
* @return string|null
*/
public function getUrl()
{
return $this->url;
}
/**
* @param string|null $url
*
* @return void
*/
public function setUrl($url)
{
$this->url = $url;
}
/**
* @return bool|null
*/
public function isHideUrl()
{
return $this->hideUrl;
}
/**
* @param bool|null $hideUrl
*
* @return void
*/
public function setHideUrl($hideUrl)
{
$this->hideUrl = $hideUrl;
}
/**
* @return string|null
*/
public function getDescription()
{
return $this->description;
}
/**
* @param string|null $description
*
* @return void
*/
public function setDescription($description)
{
$this->description = $description;
}
/**
* @return string|null
*/
public function getThumbnailUrl()
{
return $this->thumbnailUrl;
}
/**
* @param string|null $thumbnailUrl
*
* @return void
*/
public function setThumbnailUrl($thumbnailUrl)
{
$this->thumbnailUrl = $thumbnailUrl;
}
/**
* @deprecated Use getThumbnailUrl
*
* @return string|null
*/
public function getThumbUrl()
{
return $this->getThumbnailUrl();
}
/**
* @deprecated Use setThumbnailUrl
*
* @param string|null $thumbUrl
*
* @return void
*/
public function setThumbUrl($thumbUrl)
{
$this->setThumbnailUrl($thumbUrl);
}
/**
* @return int|null
*/
public function getThumbnailWidth()
{
return $this->thumbnailWidth;
}
/**
* @param int|null $thumbnailWidth
*
* @return void
*/
public function setThumbnailWidth($thumbnailWidth)
{
$this->thumbnailWidth = $thumbnailWidth;
}
/**
* @deprecated Use getThumbnailWidth
*
* @return int|null
*/
public function getThumbWidth()
{
return $this->getThumbnailWidth();
}
/**
* @deprecated Use setThumbnailWidth
*
* @param int|null $thumbWidth
*
* @return void
*/
public function setThumbWidth($thumbWidth)
{
$this->setThumbnailWidth($thumbWidth);
}
/**
* @return int|null
*/
public function getThumbnailHeight()
{
return $this->thumbnailHeight;
}
/**
* @param int|null $thumbnailHeight
*
* @return void
*/
public function setThumbnailHeight($thumbnailHeight)
{
$this->thumbnailHeight = $thumbnailHeight;
}
/**
* @deprecated Use getThumbnailHeight
*
* @return int|null
*/
public function getThumbHeight()
{
return $this->getThumbnailHeight();
}
/**
* @deprecated Use setThumbnailWidth
*
* @param int|null $thumbHeight
*
* @return void
*/
public function setThumbHeight($thumbHeight)
{
$this->setThumbnailHeight($thumbHeight);
}
}

View File

@@ -0,0 +1,158 @@
<?php
/**
* Created by PhpStorm.
* User: iGusev
* Date: 14/04/16
* Time: 16:53
*/
namespace TelegramBot\Api\Types\Inline\QueryResult;
use TelegramBot\Api\Types\Inline\InlineKeyboardMarkup;
use TelegramBot\Api\Types\Inline\InputMessageContent;
/**
* Class Audio
*
* @see https://core.telegram.org/bots/api#inlinequeryresultaudio
* Represents a link to an mp3 audio file. By default, this audio file will be sent by the user.
* Alternatively, you can use InputMessageContent to send a message with the specified content instead of the audio.
*
* Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.
*
* @package TelegramBot\Api\Types\Inline\QueryResult
*/
class Audio extends AbstractInlineQueryResult
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['type', 'id', 'audio_url', 'title'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'type' => true,
'id' => true,
'audio_url' => true,
'title' => true,
'performer' => true,
'audio_duration' => true,
'reply_markup' => InlineKeyboardMarkup::class,
'input_message_content' => InputMessageContent::class,
];
/**
* {@inheritdoc}
*
* @var string
*/
protected $type = 'audio';
/**
* A valid URL for the audio file
*
* @var string
*/
protected $audioUrl;
/**
* Optional. Performer
*
* @var string|null
*/
protected $performer;
/**
* Optional. Audio duration in seconds
*
* @var int|null
*/
protected $audioDuration;
/**
* Audio constructor.
*
* @param string $id
* @param string $audioUrl
* @param string $title
* @param string|null $performer
* @param int|null $audioDuration
* @param InputMessageContent|null $inputMessageContent
* @param InlineKeyboardMarkup|null $inlineKeyboardMarkup
*/
public function __construct(
$id,
$audioUrl,
$title,
$performer = null,
$audioDuration = null,
$inputMessageContent = null,
$inlineKeyboardMarkup = null
) {
parent::__construct($id, $title, $inputMessageContent, $inlineKeyboardMarkup);
$this->audioUrl = $audioUrl;
$this->performer = $performer;
$this->audioDuration = $audioDuration;
}
/**
* @return string
*/
public function getAudioUrl()
{
return $this->audioUrl;
}
/**
* @param string $audioUrl
*
* @return void
*/
public function setAudioUrl($audioUrl)
{
$this->audioUrl = $audioUrl;
}
/**
* @return string|null
*/
public function getPerformer()
{
return $this->performer;
}
/**
* @param string|null $performer
*
* @return void
*/
public function setPerformer($performer)
{
$this->performer = $performer;
}
/**
* @return int|null
*/
public function getAudioDuration()
{
return $this->audioDuration;
}
/**
* @param int|null $audioDuration
*
* @return void
*/
public function setAudioDuration($audioDuration)
{
$this->audioDuration = $audioDuration;
}
}

View File

@@ -0,0 +1,297 @@
<?php
/**
* Created by PhpStorm.
* User: iGusev
* Date: 14/04/16
* Time: 03:58
*/
namespace TelegramBot\Api\Types\Inline\QueryResult;
use TelegramBot\Api\Types\Inline\InlineKeyboardMarkup;
use TelegramBot\Api\Types\Inline\InputMessageContent;
class Contact extends AbstractInlineQueryResult
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['type', 'id', 'phone_number', 'first_name'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'type' => true,
'id' => true,
'phone_number' => true,
'first_name' => true,
'last_name' => true,
'reply_markup' => InlineKeyboardMarkup::class,
'input_message_content' => InputMessageContent::class,
'thumbnail_url' => true,
'thumbnail_width' => true,
'thumbnail_height' => true,
];
/**
* {@inheritdoc}
*
* @var string
*/
protected $type = 'contact';
/**
* Contact's phone number
*
* @var string
*/
protected $phoneNumber;
/**
* Contact's first name
*
* @var string
*/
protected $firstName;
/**
* Optional. Contact's last name
*
* @var string|null
*/
protected $lastName;
/**
* Optional. Url of the thumbnail for the result
*
* @var string|null
*/
protected $thumbnailUrl;
/**
* Optional. Thumbnail width
*
* @var int|null
*/
protected $thumbnailWidth;
/**
* Optional. Thumbnail height
*
* @var int|null
*/
protected $thumbnailHeight;
/**
* Contact constructor.
*
* @param string $id
* @param string $phoneNumber
* @param string $firstName
* @param string $lastName
* @param string $thumbnailUrl
* @param int $thumbnailWidth
* @param int $thumbnailHeight
* @param InputMessageContent|null $inputMessageContent
* @param InlineKeyboardMarkup|null $inlineKeyboardMarkup
*/
public function __construct(
$id,
$phoneNumber,
$firstName,
$lastName = null,
$thumbnailUrl = null,
$thumbnailWidth = null,
$thumbnailHeight = null,
$inputMessageContent = null,
$inlineKeyboardMarkup = null
) {
parent::__construct($id, null, $inputMessageContent, $inlineKeyboardMarkup);
$this->phoneNumber = $phoneNumber;
$this->firstName = $firstName;
$this->lastName = $lastName;
$this->thumbnailUrl = $thumbnailUrl;
$this->thumbnailWidth = $thumbnailWidth;
$this->thumbnailHeight = $thumbnailHeight;
}
/**
* @return string
*/
public function getPhoneNumber()
{
return $this->phoneNumber;
}
/**
* @param string $phoneNumber
*
* @return void
*/
public function setPhoneNumber($phoneNumber)
{
$this->phoneNumber = $phoneNumber;
}
/**
* @return string
*/
public function getFirstName()
{
return $this->firstName;
}
/**
* @param string $firstName
*
* @return void
*/
public function setFirstName($firstName)
{
$this->firstName = $firstName;
}
/**
* @return string|null
*/
public function getLastName()
{
return $this->lastName;
}
/**
* @param string|null $lastName
*
* @return void
*/
public function setLastName($lastName)
{
$this->lastName = $lastName;
}
/**
* @return string|null
*/
public function getThumbnailUrl()
{
return $this->thumbnailUrl;
}
/**
* @param string|null $thumbnailUrl
*
* @return void
*/
public function setThumbnailUrl($thumbnailUrl)
{
$this->thumbnailUrl = $thumbnailUrl;
}
/**
* @deprecated Use getThumbnailUrl
*
* @return string|null
*/
public function getThumbUrl()
{
return $this->getThumbnailUrl();
}
/**
* @deprecated Use setThumbnailUrl
*
* @param string|null $thumbUrl
*
* @return void
*/
public function setThumbUrl($thumbUrl)
{
$this->setThumbnailUrl($thumbUrl);
}
/**
* @return int|null
*/
public function getThumbnailWidth()
{
return $this->thumbnailWidth;
}
/**
* @param int|null $thumbnailWidth
*
* @return void
*/
public function setThumbnailWidth($thumbnailWidth)
{
$this->thumbnailWidth = $thumbnailWidth;
}
/**
* @deprecated Use getThumbnailWidth
*
* @return int|null
*/
public function getThumbWidth()
{
return $this->getThumbnailWidth();
}
/**
* @deprecated Use setThumbnailWidth
*
* @param int|null $thumbWidth
*
* @return void
*/
public function setThumbWidth($thumbWidth)
{
$this->setThumbnailWidth($thumbWidth);
}
/**
* @return int|null
*/
public function getThumbnailHeight()
{
return $this->thumbnailHeight;
}
/**
* @param int|null $thumbnailHeight
*
* @return void
*/
public function setThumbnailHeight($thumbnailHeight)
{
$this->thumbnailHeight = $thumbnailHeight;
}
/**
* @deprecated Use getThumbnailHeight
*
* @return int|null
*/
public function getThumbHeight()
{
return $this->getThumbnailHeight();
}
/**
* @deprecated Use setThumbnailWidth
*
* @param int|null $thumbHeight
*
* @return void
*/
public function setThumbHeight($thumbHeight)
{
$this->setThumbnailHeight($thumbHeight);
}
}

View File

@@ -0,0 +1,229 @@
<?php
namespace TelegramBot\Api\Types\Inline\QueryResult;
use TelegramBot\Api\Types\Inline\InlineKeyboardMarkup;
use TelegramBot\Api\Types\Inline\InputMessageContent;
/**
* Class InlineQueryResultGif
* Represents a link to an animated GIF file.
* By default, this animated GIF file will be sent by the user with optional caption.
* Alternatively, you can provide InputMessageContent to send it instead of the animation.
*
* @package TelegramBot\Api\Types\Inline
*/
class Gif extends AbstractInlineQueryResult
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['type', 'id', 'gif_url', 'thumbnail_url'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'type' => true,
'id' => true,
'gif_url' => true,
'gif_width' => true,
'gif_height' => true,
'thumbnail_url' => true,
'title' => true,
'caption' => true,
'reply_markup' => InlineKeyboardMarkup::class,
'input_message_content' => InputMessageContent::class,
];
/**
* {@inheritdoc}
*
* @var string
*/
protected $type = 'gif';
/**
* A valid URL for the GIF file. File size must not exceed 1MB
*
* @var string
*/
protected $gifUrl;
/**
* Optional. Width of the GIF
*
* @var int|null
*/
protected $gifWidth;
/**
* Optional. Height of the GIF
*
* @var int|null
*/
protected $gifHeight;
/**
* URL of the static thumbnail for the result (jpeg or gif)
*
* @var string
*/
protected $thumbnailUrl;
/**
* Optional. Caption of the GIF file to be sent, 0-200 characters
*
* @var string|null
*/
protected $caption;
/**
* InlineQueryResultGif constructor.
*
* @param string $id
* @param string $gifUrl
* @param string|null $thumbnailUrl
* @param int|null $gifWidth
* @param int|null $gifHeight
* @param string|null $title
* @param string|null $caption
* @param InputMessageContent $inputMessageContent
* @param InlineKeyboardMarkup|null $inlineKeyboardMarkup
*/
public function __construct(
$id,
$gifUrl,
$thumbnailUrl = null,
$title = null,
$caption = null,
$gifWidth = null,
$gifHeight = null,
$inputMessageContent = null,
$inlineKeyboardMarkup = null
) {
parent::__construct($id, $title, $inputMessageContent, $inlineKeyboardMarkup);
$this->gifUrl = $gifUrl;
$this->thumbnailUrl = is_null($thumbnailUrl) ? $gifUrl : $thumbnailUrl;
$this->gifWidth = $gifWidth;
$this->gifHeight = $gifHeight;
$this->caption = $caption;
}
/**
* @return string
*/
public function getGifUrl()
{
return $this->gifUrl;
}
/**
* @param string $gifUrl
*
* @return void
*/
public function setGifUrl($gifUrl)
{
$this->gifUrl = $gifUrl;
}
/**
* @return int|null
*/
public function getGifWidth()
{
return $this->gifWidth;
}
/**
* @param int|null $gifWidth
*
* @return void
*/
public function setGifWidth($gifWidth)
{
$this->gifWidth = $gifWidth;
}
/**
* @return int|null
*/
public function getGifHeight()
{
return $this->gifHeight;
}
/**
* @param int|null $gifHeight
*
* @return void
*/
public function setGifHeight($gifHeight)
{
$this->gifHeight = $gifHeight;
}
/**
* @return string
*/
public function getThumbnailUrl()
{
return $this->thumbnailUrl;
}
/**
* @param string $thumbnailUrl
*
* @return void
*/
public function setThumbnailUrl($thumbnailUrl)
{
$this->thumbnailUrl = $thumbnailUrl;
}
/**
* @deprecated Use getThumbnailUrl
*
* @return string
*/
public function getThumbUrl()
{
return $this->getThumbnailUrl();
}
/**
* @deprecated Use setThumbnailUrl
*
* @param string $thumbUrl
*
* @return void
*/
public function setThumbUrl($thumbUrl)
{
$this->setThumbnailUrl($thumbUrl);
}
/**
* @return string|null
*/
public function getCaption()
{
return $this->caption;
}
/**
* @param string|null $caption
*
* @return void
*/
public function setCaption($caption)
{
$this->caption = $caption;
}
}

View File

@@ -0,0 +1,282 @@
<?php
/**
* Created by PhpStorm.
* User: iGusev
* Date: 18/04/16
* Time: 04:00
*/
namespace TelegramBot\Api\Types\Inline\QueryResult;
use TelegramBot\Api\Types\Inline\InlineKeyboardMarkup;
use TelegramBot\Api\Types\Inline\InputMessageContent;
/**
* Class Location
*
* @see https://core.telegram.org/bots/api#inlinequeryresultlocation
* Represents a location on a map. By default, the location will be sent by the user.
* Alternatively, you can use InputMessageContent to send a message with the specified content instead of the location.
*
* Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.
*
* @package TelegramBot\Api\Types\Inline\QueryResult
*/
class Location extends AbstractInlineQueryResult
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['type', 'id', 'latitude', 'longitude', 'title'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'type' => true,
'id' => true,
'latitude' => true,
'longitude' => true,
'title' => true,
'thumbnail_url' => true,
'thumbnail_width' => true,
'thumbnail_height' => true,
'reply_markup' => InlineKeyboardMarkup::class,
'input_message_content' => InputMessageContent::class,
];
/**
* {@inheritdoc}
*
* @var string
*/
protected $type = 'location';
/**
* Location latitude in degrees
*
* @var float
*/
protected $latitude;
/**
* Location longitude in degrees
*
* @var float
*/
protected $longitude;
/**
* Optional. Url of the thumbnail for the result
*
* @var string|null
*/
protected $thumbnailUrl;
/**
* Optional. Thumbnail width
*
* @var int|null
*/
protected $thumbnailWidth;
/**
* Optional. Thumbnail height
*
* @var int|null
*/
protected $thumbnailHeight;
/**
* Voice constructor
*
* @param string $id
* @param float $latitude
* @param float $longitude
* @param string $title
* @param string|null $thumbnailUrl
* @param int|null $thumbnailWidth
* @param int|null $thumbnailHeight
* @param InlineKeyboardMarkup|null $inlineKeyboardMarkup
* @param InputMessageContent|null $inputMessageContent
*/
public function __construct(
$id,
$latitude,
$longitude,
$title,
$thumbnailUrl = null,
$thumbnailWidth = null,
$thumbnailHeight = null,
$inlineKeyboardMarkup = null,
$inputMessageContent = null
) {
parent::__construct($id, $title, $inputMessageContent, $inlineKeyboardMarkup);
$this->latitude = $latitude;
$this->longitude = $longitude;
$this->thumbnailUrl = $thumbnailUrl;
$this->thumbnailWidth = $thumbnailWidth;
$this->thumbnailHeight = $thumbnailHeight;
}
/**
* @return float
*/
public function getLatitude()
{
return $this->latitude;
}
/**
* @param float $latitude
*
* @return void
*/
public function setLatitude($latitude)
{
$this->latitude = $latitude;
}
/**
* @return float
*/
public function getLongitude()
{
return $this->longitude;
}
/**
* @param float $longitude
*
* @return void
*/
public function setLongitude($longitude)
{
$this->longitude = $longitude;
}
/**
* @return string|null
*/
public function getThumbnailUrl()
{
return $this->thumbnailUrl;
}
/**
* @param string|null $thumbnailUrl
*
* @return void
*/
public function setThumbnailUrl($thumbnailUrl)
{
$this->thumbnailUrl = $thumbnailUrl;
}
/**
* @deprecated Use getThumbnailUrl
*
* @return string|null
*/
public function getThumbUrl()
{
return $this->getThumbnailUrl();
}
/**
* @deprecated Use setThumbnailUrl
*
* @param string|null $thumbUrl
*
* @return void
*/
public function setThumbUrl($thumbUrl)
{
$this->setThumbnailUrl($thumbUrl);
}
/**
* @return int|null
*/
public function getThumbnailWidth()
{
return $this->thumbnailWidth;
}
/**
* @param int|null $thumbnailWidth
*
* @return void
*/
public function setThumbnailWidth($thumbnailWidth)
{
$this->thumbnailWidth = $thumbnailWidth;
}
/**
* @deprecated Use getThumbnailWidth
*
* @return int|null
*/
public function getThumbWidth()
{
return $this->getThumbnailWidth();
}
/**
* @deprecated Use setThumbnailWidth
*
* @param int|null $thumbWidth
*
* @return void
*/
public function setThumbWidth($thumbWidth)
{
$this->setThumbnailWidth($thumbWidth);
}
/**
* @return int|null
*/
public function getThumbnailHeight()
{
return $this->thumbnailHeight;
}
/**
* @param int|null $thumbnailHeight
*
* @return void
*/
public function setThumbnailHeight($thumbnailHeight)
{
$this->thumbnailHeight = $thumbnailHeight;
}
/**
* @deprecated Use getThumbnailHeight
*
* @return int|null
*/
public function getThumbHeight()
{
return $this->getThumbnailHeight();
}
/**
* @deprecated Use setThumbnailWidth
*
* @param int|null $thumbHeight
*
* @return void
*/
public function setThumbHeight($thumbHeight)
{
$this->setThumbnailHeight($thumbHeight);
}
}

View File

@@ -0,0 +1,229 @@
<?php
namespace TelegramBot\Api\Types\Inline\QueryResult;
use TelegramBot\Api\Types\Inline\InlineKeyboardMarkup;
use TelegramBot\Api\Types\Inline\InputMessageContent;
/**
* Class InlineQueryResultMpeg4Gif
* Represents a link to a video animation (H.264/MPEG-4 AVC video without sound).
* By default, this animated MPEG-4 file will be sent by the user with optional caption.
* Alternatively, you can provide message_text to send it instead of the animation.
*
* @package TelegramBot\Api\Types\Inline
*/
class Mpeg4Gif extends AbstractInlineQueryResult
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['type', 'id', 'mpeg4_url', 'thumbnail_url'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'type' => true,
'id' => true,
'mpeg4_url' => true,
'mpeg4_width' => true,
'mpeg4_height' => true,
'thumbnail_url' => true,
'title' => true,
'caption' => true,
'reply_markup' => InlineKeyboardMarkup::class,
'input_message_content' => InputMessageContent::class,
];
/**
* {@inheritdoc}
*
* @var string
*/
protected $type = 'mpeg4_gif';
/**
* A valid URL for the MP4 file. File size must not exceed 1MB
*
* @var string
*/
protected $mpeg4Url;
/**
* Optional. Video width
*
* @var int|null
*/
protected $mpeg4Width;
/**
* Optional. Video height
*
* @var int|null
*/
protected $mpeg4Height;
/**
* URL of the static thumbnail (jpeg or gif) for the result
*
* @var string
*/
protected $thumbnailUrl;
/**
* Optional. Caption of the MPEG-4 file to be sent, 0-200 characters
*
* @var string|null
*/
protected $caption;
/**
* InlineQueryResultMpeg4Gif constructor.
*
* @param string $id
* @param string $mpeg4Url
* @param string $thumbnailUrl
* @param int|null $mpeg4Width
* @param int|null $mpeg4Height
* @param string|null $caption
* @param string|null $title
* @param InputMessageContent $inputMessageContent
* @param InlineKeyboardMarkup|null $inlineKeyboardMarkup
*/
public function __construct(
$id,
$mpeg4Url,
$thumbnailUrl,
$title = null,
$caption = null,
$mpeg4Width = null,
$mpeg4Height = null,
$inputMessageContent = null,
$inlineKeyboardMarkup = null
) {
parent::__construct($id, $title, $inputMessageContent, $inlineKeyboardMarkup);
$this->mpeg4Url = $mpeg4Url;
$this->thumbnailUrl = $thumbnailUrl;
$this->mpeg4Width = $mpeg4Width;
$this->mpeg4Height = $mpeg4Height;
$this->caption = $caption;
}
/**
* @return string
*/
public function getMpeg4Url()
{
return $this->mpeg4Url;
}
/**
* @param string $mpeg4Url
*
* @return void
*/
public function setMpeg4Url($mpeg4Url)
{
$this->mpeg4Url = $mpeg4Url;
}
/**
* @return int|null
*/
public function getMpeg4Width()
{
return $this->mpeg4Width;
}
/**
* @param int|null $mpeg4Width
*
* @return void
*/
public function setMpeg4Width($mpeg4Width)
{
$this->mpeg4Width = $mpeg4Width;
}
/**
* @return int|null
*/
public function getMpeg4Height()
{
return $this->mpeg4Height;
}
/**
* @param int|null $mpeg4Height
*
* @return void
*/
public function setMpeg4Height($mpeg4Height)
{
$this->mpeg4Height = $mpeg4Height;
}
/**
* @return string
*/
public function getThumbnailUrl()
{
return $this->thumbnailUrl;
}
/**
* @param string $thumbnailUrl
*
* @return void
*/
public function setThumbnailUrl($thumbnailUrl)
{
$this->thumbnailUrl = $thumbnailUrl;
}
/**
* @deprecated Use getThumbnailUrl
*
* @return string
*/
public function getThumbUrl()
{
return $this->getThumbnailUrl();
}
/**
* @deprecated Use setThumbnailUrl
*
* @param string $thumbUrl
*
* @return void
*/
public function setThumbUrl($thumbUrl)
{
$this->setThumbnailUrl($thumbUrl);
}
/**
* @return string|null
*/
public function getCaption()
{
return $this->caption;
}
/**
* @param string|null $caption
*
* @return void
*/
public function setCaption($caption)
{
$this->caption = $caption;
}
}

View File

@@ -0,0 +1,257 @@
<?php
namespace TelegramBot\Api\Types\Inline\QueryResult;
use TelegramBot\Api\Types\Inline\InlineKeyboardMarkup;
use TelegramBot\Api\Types\Inline\InputMessageContent;
/**
* Class InlineQueryResultPhoto
* Represents a link to a photo. By default, this photo will be sent by the user with optional caption.
* Alternatively, you can provide message_text to send it instead of photo.
*
* @package TelegramBot\Api\Types\Inline
*/
class Photo extends AbstractInlineQueryResult
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['type', 'id', 'photo_url', 'thumbnail_url'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'type' => true,
'id' => true,
'photo_url' => true,
'thumbnail_url' => true,
'photo_width' => true,
'photo_height' => true,
'title' => true,
'description' => true,
'caption' => true,
'input_message_content' => InputMessageContent::class,
'reply_markup' => InlineKeyboardMarkup::class,
];
/**
* {@inheritdoc}
*
* @var string
*/
protected $type = 'photo';
/**
* A valid URL of the photo. Photo size must not exceed 5MB
*
* @var string
*/
protected $photoUrl;
/**
* Optional. Width of the photo
*
* @var int|null
*/
protected $photoWidth;
/**
* Optional. Height of the photo
*
* @var int|null
*/
protected $photoHeight;
/**
* URL of the thumbnail for the photo
*
* @var string
*/
protected $thumbnailUrl;
/**
* Optional. Short description of the result
*
* @var string|null
*/
protected $description;
/**
* Optional. Caption of the photo to be sent, 0-200 characters
*
* @var string|null
*/
protected $caption;
/**
* InlineQueryResultPhoto constructor.
*
* @param string $id
* @param string $photoUrl
* @param string $thumbnailUrl
* @param int|null $photoWidth
* @param int|null $photoHeight
* @param string|null $title
* @param string|null $description
* @param string|null $caption
* @param InputMessageContent|null $inputMessageContent
* @param InlineKeyboardMarkup|null $inlineKeyboardMarkup
*/
public function __construct(
$id,
$photoUrl,
$thumbnailUrl,
$photoWidth = null,
$photoHeight = null,
$title = null,
$description = null,
$caption = null,
$inputMessageContent = null,
$inlineKeyboardMarkup = null
) {
parent::__construct($id, $title, $inputMessageContent, $inlineKeyboardMarkup);
$this->photoUrl = $photoUrl;
$this->thumbnailUrl = $thumbnailUrl;
$this->photoWidth = $photoWidth;
$this->photoHeight = $photoHeight;
$this->description = $description;
$this->caption = $caption;
}
/**
* @return string
*/
public function getPhotoUrl()
{
return $this->photoUrl;
}
/**
* @param string $photoUrl
*
* @return void
*/
public function setPhotoUrl($photoUrl)
{
$this->photoUrl = $photoUrl;
}
/**
* @return int|null
*/
public function getPhotoWidth()
{
return $this->photoWidth;
}
/**
* @param int|null $photoWidth
*
* @return void
*/
public function setPhotoWidth($photoWidth)
{
$this->photoWidth = $photoWidth;
}
/**
* @return int|null
*/
public function getPhotoHeight()
{
return $this->photoHeight;
}
/**
* @param int|null $photoHeight
*
* @return void
*/
public function setPhotoHeight($photoHeight)
{
$this->photoHeight = $photoHeight;
}
/**
* @return string
*/
public function getThumbnailUrl()
{
return $this->thumbnailUrl;
}
/**
* @param string $thumbnailUrl
*
* @return void
*/
public function setThumbnailUrl($thumbnailUrl)
{
$this->thumbnailUrl = $thumbnailUrl;
}
/**
* @deprecated Use getThumbnailUrl
*
* @return string
*/
public function getThumbUrl()
{
return $this->getThumbnailUrl();
}
/**
* @deprecated Use setThumbnailUrl
*
* @param string $thumbUrl
*
* @return void
*/
public function setThumbUrl($thumbUrl)
{
$this->setThumbnailUrl($thumbUrl);
}
/**
* @return string|null
*/
public function getDescription()
{
return $this->description;
}
/**
* @param string|null $description
*
* @return void
*/
public function setDescription($description)
{
$this->description = $description;
}
/**
* @return string|null
*/
public function getCaption()
{
return $this->caption;
}
/**
* @param string|null $caption
*
* @return void
*/
public function setCaption($caption)
{
$this->caption = $caption;
}
}

View File

@@ -0,0 +1,340 @@
<?php
/**
* Created by PhpStorm.
* User: iGusev
* Date: 18/04/16
* Time: 04:19
*/
namespace TelegramBot\Api\Types\Inline\QueryResult;
use TelegramBot\Api\Types\Inline\InlineKeyboardMarkup;
use TelegramBot\Api\Types\Inline\InputMessageContent;
/**
* Class Venue
*
* @see https://core.telegram.org/bots/api#inlinequeryresultvenue
* Represents a venue. By default, the venue will be sent by the user.
* Alternatively, you can use InputMessageContent to send a message with the specified content instead of the venue.
*
* Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.
*
* @package TelegramBot\Api\Types\Inline\QueryResult
*/
class Venue extends AbstractInlineQueryResult
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['type', 'id', 'latitude', 'longitude', 'title', 'address'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'type' => true,
'id' => true,
'latitude' => true,
'longitude' => true,
'title' => true,
'address' => true,
'foursquare_id' => true,
'thumbnail_url' => true,
'thumbnail_width' => true,
'thumbnail_height' => true,
'reply_markup' => InlineKeyboardMarkup::class,
'input_message_content' => InputMessageContent::class,
];
/**
* {@inheritdoc}
*
* @var string
*/
protected $type = 'venue';
/**
* Latitude of the venue location in degrees
*
* @var float
*/
protected $latitude;
/**
* Longitude of the venue location in degrees
*
* @var float
*/
protected $longitude;
/**
* Optional. Thumbnail width
*
* @var string|null
*/
protected $address;
/**
* Optional. Url of the thumbnail for the result
*
* @var string|null
*/
protected $thumbnailUrl;
/**
* Optional. Thumbnail width
*
* @var int|null
*/
protected $thumbnailWidth;
/**
* Optional. Thumbnail height
*
* @var int|null
*/
protected $thumbnailHeight;
/**
* Optional. Foursquare identifier of the venue if known
*
* @var string|null
*/
protected $foursquareId;
/**
* Voice constructor
*
* @param string $id
* @param float $latitude
* @param float $longitude
* @param string $title
* @param string $address
* @param string|null $thumbnailUrl
* @param int|null $thumbnailWidth
* @param int|null $thumbnailHeight
* @param string|null $foursquareId
* @param InlineKeyboardMarkup|null $inlineKeyboardMarkup
* @param InputMessageContent|null $inputMessageContent
*/
public function __construct(
$id,
$latitude,
$longitude,
$title,
$address,
$thumbnailUrl = null,
$thumbnailWidth = null,
$thumbnailHeight = null,
$foursquareId = null,
$inputMessageContent = null,
$inlineKeyboardMarkup = null
) {
parent::__construct($id, $title, $inputMessageContent, $inlineKeyboardMarkup);
$this->latitude = $latitude;
$this->longitude = $longitude;
$this->address = $address;
$this->thumbnailUrl = $thumbnailUrl;
$this->thumbnailWidth = $thumbnailWidth;
$this->thumbnailHeight = $thumbnailHeight;
$this->foursquareId = $foursquareId;
}
/**
* @return float
*/
public function getLatitude()
{
return $this->latitude;
}
/**
* @param float $latitude
*
* @return void
*/
public function setLatitude($latitude)
{
$this->latitude = $latitude;
}
/**
* @return float
*/
public function getLongitude()
{
return $this->longitude;
}
/**
* @param float $longitude
*
* @return void
*/
public function setLongitude($longitude)
{
$this->longitude = $longitude;
}
/**
* @return string|null
*/
public function getAddress()
{
return $this->address;
}
/**
* @param string|null $address
*
* @return void
*/
public function setAddress($address)
{
$this->address = $address;
}
/**
* @return string|null
*/
public function getFoursquareId()
{
return $this->foursquareId;
}
/**
* @param string|null $foursquareId
*
* @return void
*/
public function setFoursquareId($foursquareId)
{
$this->foursquareId = $foursquareId;
}
/**
* @return string|null
*/
public function getThumbnailUrl()
{
return $this->thumbnailUrl;
}
/**
* @param string|null $thumbnailUrl
*
* @return void
*/
public function setThumbnailUrl($thumbnailUrl)
{
$this->thumbnailUrl = $thumbnailUrl;
}
/**
* @deprecated Use getThumbnailUrl
*
* @return string|null
*/
public function getThumbUrl()
{
return $this->getThumbnailUrl();
}
/**
* @deprecated Use setThumbnailUrl
*
* @param string|null $thumbUrl
*
* @return void
*/
public function setThumbUrl($thumbUrl)
{
$this->setThumbnailUrl($thumbUrl);
}
/**
* @return int|null
*/
public function getThumbnailWidth()
{
return $this->thumbnailWidth;
}
/**
* @param int|null $thumbnailWidth
*
* @return void
*/
public function setThumbnailWidth($thumbnailWidth)
{
$this->thumbnailWidth = $thumbnailWidth;
}
/**
* @deprecated Use getThumbnailWidth
*
* @return int|null
*/
public function getThumbWidth()
{
return $this->getThumbnailWidth();
}
/**
* @deprecated Use setThumbnailWidth
*
* @param int|null $thumbWidth
*
* @return void
*/
public function setThumbWidth($thumbWidth)
{
$this->setThumbnailWidth($thumbWidth);
}
/**
* @return int|null
*/
public function getThumbnailHeight()
{
return $this->thumbnailHeight;
}
/**
* @param int|null $thumbnailHeight
*
* @return void
*/
public function setThumbnailHeight($thumbnailHeight)
{
$this->thumbnailHeight = $thumbnailHeight;
}
/**
* @deprecated Use getThumbnailHeight
*
* @return int|null
*/
public function getThumbHeight()
{
return $this->getThumbnailHeight();
}
/**
* @deprecated Use setThumbnailWidth
*
* @param int|null $thumbHeight
*
* @return void
*/
public function setThumbHeight($thumbHeight)
{
$this->setThumbnailHeight($thumbHeight);
}
}

View File

@@ -0,0 +1,314 @@
<?php
namespace TelegramBot\Api\Types\Inline\QueryResult;
use TelegramBot\Api\Types\Inline\InlineKeyboardMarkup;
use TelegramBot\Api\Types\Inline\InputMessageContent;
/**
* Class InlineQueryResultVideo
* Represents link to a page containing an embedded video player or a video file.
*
* @package TelegramBot\Api\Types\Inline
*/
class Video extends AbstractInlineQueryResult
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['type', 'id', 'video_url', 'mime_type', 'thumbnail_url', 'title'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'type' => true,
'id' => true,
'video_url' => true,
'mime_type' => true,
'thumbnail_url' => true,
'title' => true,
'caption' => true,
'description' => true,
'video_width' => true,
'video_height' => true,
'video_duration' => true,
'reply_markup' => InlineKeyboardMarkup::class,
'input_message_content' => InputMessageContent::class,
];
/**
* {@inheritdoc}
*
* @var string
*/
protected $type = 'video';
/**
* A valid URL for the embedded video player or video file
*
* @var string
*/
protected $videoUrl;
/**
* Mime type of the content of video url, “text/html” or “video/mp4”
*
* @var string
*/
protected $mimeType;
/**
* Optional. Video width
*
* @var int|null
*/
protected $videoWidth;
/**
* Optional. Video height
*
* @var int|null
*/
protected $videoHeight;
/**
* Optional. Video duration in seconds
*
* @var int|null
*/
protected $videoDuration;
/**
* URL of the thumbnail (jpeg only) for the video
*
* @var string
*/
protected $thumbnailUrl;
/**
* Optional. Short description of the result
*
* @var string|null
*/
protected $caption;
/**
* Optional. Short description of the result
*
* @var string|null
*/
protected $description;
/**
* Video constructor
*
* @param string $id
* @param string $videoUrl
* @param string $thumbnailUrl
* @param string $mimeType
* @param string $title
* @param string|null $caption
* @param string|null $description
* @param int|null $videoWidth
* @param int|null $videoHeight
* @param int|null $videoDuration
* @param InputMessageContent|null $inputMessageContent
* @param InlineKeyboardMarkup|null $inlineKeyboardMarkup
*/
public function __construct(
$id,
$videoUrl,
$thumbnailUrl,
$mimeType,
$title,
$caption = null,
$description = null,
$videoWidth = null,
$videoHeight = null,
$videoDuration = null,
$inputMessageContent = null,
$inlineKeyboardMarkup = null
) {
parent::__construct($id, $title, $inputMessageContent, $inlineKeyboardMarkup);
$this->videoUrl = $videoUrl;
$this->thumbnailUrl = $thumbnailUrl;
$this->caption = $caption;
$this->description = $description;
$this->mimeType = $mimeType;
$this->videoWidth = $videoWidth;
$this->videoHeight = $videoHeight;
$this->videoDuration = $videoDuration;
}
/**
* @return string
*/
public function getVideoUrl()
{
return $this->videoUrl;
}
/**
* @param string $videoUrl
*
* @return void
*/
public function setVideoUrl($videoUrl)
{
$this->videoUrl = $videoUrl;
}
/**
* @return string
*/
public function getMimeType()
{
return $this->mimeType;
}
/**
* @param string $mimeType
*
* @return void
*/
public function setMimeType($mimeType)
{
$this->mimeType = $mimeType;
}
/**
* @return int|null
*/
public function getVideoWidth()
{
return $this->videoWidth;
}
/**
* @param int|null $videoWidth
*
* @return void
*/
public function setVideoWidth($videoWidth)
{
$this->videoWidth = $videoWidth;
}
/**
* @return int|null
*/
public function getVideoHeight()
{
return $this->videoHeight;
}
/**
* @param int|null $videoHeight
*
* @return void
*/
public function setVideoHeight($videoHeight)
{
$this->videoHeight = $videoHeight;
}
/**
* @return int|null
*/
public function getVideoDuration()
{
return $this->videoDuration;
}
/**
* @param int|null $videoDuration
*
* @return void
*/
public function setVideoDuration($videoDuration)
{
$this->videoDuration = $videoDuration;
}
/**
* @return string
*/
public function getThumbnailUrl()
{
return $this->thumbnailUrl;
}
/**
* @param string $thumbnailUrl
*
* @return void
*/
public function setThumbnailUrl($thumbnailUrl)
{
$this->thumbnailUrl = $thumbnailUrl;
}
/**
* @deprecated Use getThumbnailUrl
*
* @return string
*/
public function getThumbUrl()
{
return $this->getThumbnailUrl();
}
/**
* @deprecated Use setThumbnailUrl
*
* @param string $thumbUrl
*
* @return void
*/
public function setThumbUrl($thumbUrl)
{
$this->setThumbnailUrl($thumbUrl);
}
/**
* @return string|null
*/
public function getCaption()
{
return $this->caption;
}
/**
* @param string|null $caption
*
* @return void
*/
public function setCaption($caption)
{
$this->caption = $caption;
}
/**
* @return string|null
*/
public function getDescription()
{
return $this->description;
}
/**
* @param string|null $description
*
* @return void
*/
public function setDescription($description)
{
$this->description = $description;
}
}

View File

@@ -0,0 +1,131 @@
<?php
/**
* Created by PhpStorm.
* User: iGusev
* Date: 17/04/16
* Time: 02:12
*/
namespace TelegramBot\Api\Types\Inline\QueryResult;
use TelegramBot\Api\Types\Inline\InlineKeyboardMarkup;
use TelegramBot\Api\Types\Inline\InputMessageContent;
/**
* Class Voice
*
* @see https://core.telegram.org/bots/api#inlinequeryresultvoice
* Represents a link to an mp3 audio file. By default, this audio file will be sent by the user.
* Alternatively, you can use InputMessageContent to send a message with the specified content instead of the audio.
*
* Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.
*
* @package TelegramBot\Api\Types\Inline\QueryResult
*/
class Voice extends AbstractInlineQueryResult
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['type', 'id', 'voice_url', 'title'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'type' => true,
'id' => true,
'voice_url' => true,
'title' => true,
'voice_duration' => true,
'reply_markup' => InlineKeyboardMarkup::class,
'input_message_content' => InputMessageContent::class,
];
/**
* {@inheritdoc}
*
* @var string
*/
protected $type = 'voice';
/**
* A valid URL for the audio file
*
* @var string
*/
protected $voiceUrl;
/**
* Optional. Audio duration in seconds
*
* @var int|null
*/
protected $voiceDuration;
/**
* Voice constructor
*
* @param string $id
* @param string $voiceUrl
* @param string $title
* @param int|null $voiceDuration
* @param InlineKeyboardMarkup|null $inlineKeyboardMarkup
* @param InputMessageContent|null $inputMessageContent
*/
public function __construct(
$id,
$voiceUrl,
$title,
$voiceDuration = null,
$inlineKeyboardMarkup = null,
$inputMessageContent = null
) {
parent::__construct($id, $title, $inputMessageContent, $inlineKeyboardMarkup);
$this->voiceUrl = $voiceUrl;
$this->voiceDuration = $voiceDuration;
$this->replyMarkup = $inlineKeyboardMarkup;
$this->inputMessageContent = $inputMessageContent;
}
/**
* @return string
*/
public function getVoiceUrl()
{
return $this->voiceUrl;
}
/**
* @param string $voiceUrl
*
* @return void
*/
public function setVoiceUrl($voiceUrl)
{
$this->voiceUrl = $voiceUrl;
}
/**
* @return int|null
*/
public function getVoiceDuration()
{
return $this->voiceDuration;
}
/**
* @param int|null $voiceDuration
*
* @return void
*/
public function setVoiceDuration($voiceDuration)
{
$this->voiceDuration = $voiceDuration;
}
}

View File

@@ -0,0 +1,15 @@
<?php
namespace TelegramBot\Api\Types\InputMedia;
use TelegramBot\Api\Collection\Collection;
/**
* Class ArrayOfInputMedia
*
* @package TelegramBot\Api
*/
class ArrayOfInputMedia extends Collection
{
protected $maxCount = 10;
}

View File

@@ -0,0 +1,137 @@
<?php
namespace TelegramBot\Api\Types\InputMedia;
use TelegramBot\Api\BaseType;
use TelegramBot\Api\Collection\CollectionItemInterface;
/**
* Class InputMedia
* This object represents the content of a media message to be sent.
*
* @package TelegramBot\Api
*/
class InputMedia extends BaseType implements CollectionItemInterface
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['type', 'media'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'type' => true,
'media' => true,
'caption' => true,
'parse_mode' => true,
];
/**
* Type of the result.
*
* @var string
*/
protected $type;
/**
* File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended),
* pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>"
* to upload a new one using multipart/form-data under <file_attach_name> name.
*
* @var string
*/
protected $media;
/**
* Optional. Caption of the photo to be sent, 0-200 characters.
*
* @var string|null
*/
protected $caption;
/**
* Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic,
* fixed-width text or inline URLs in the media caption.
*
* @var string|null
*/
protected $parseMode;
/**
* @return string
*/
public function getType()
{
return $this->type;
}
/**
* @param string $type
*
* @return void
*/
public function setType($type)
{
$this->type = $type;
}
/**
* @return string
*/
public function getMedia()
{
return $this->media;
}
/**
* @param string $media
*
* @return void
*/
public function setMedia($media)
{
$this->media = $media;
}
/**
* @return string|null
*/
public function getCaption()
{
return $this->caption;
}
/**
* @param string|null $caption
*
* @return void
*/
public function setCaption($caption)
{
$this->caption = $caption;
}
/**
* @return string|null
*/
public function getParseMode()
{
return $this->parseMode;
}
/**
* @param string|null $parseMode
*
* @return void
*/
public function setParseMode($parseMode)
{
$this->parseMode = $parseMode;
}
}

View File

@@ -0,0 +1,27 @@
<?php
namespace TelegramBot\Api\Types\InputMedia;
/**
* Class InputMediaPhoto
* Represents a photo to be sent.
*
* @package TelegramBot\Api
*/
class InputMediaPhoto extends InputMedia
{
/**
* InputMediaPhoto constructor.
*
* @param string $media
* @param string|null $caption
* @param string|null $parseMode
*/
public function __construct($media, $caption = null, $parseMode = null)
{
$this->type = 'photo';
$this->media = $media;
$this->caption = $caption;
$this->parseMode = $parseMode;
}
}

View File

@@ -0,0 +1,158 @@
<?php
namespace TelegramBot\Api\Types\InputMedia;
/**
* Class InputMediaVideo
* Represents a video to be sent.
*
* @package TelegramBot\Api
*/
class InputMediaVideo extends InputMedia
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'type' => true,
'media' => true,
'caption' => true,
'parse_mode' => true,
'width' => true,
'height' => true,
'duration' => true,
'supports_streaming' => true
];
/**
* Optional. Video width.
*
* @var int|null
*/
protected $width;
/**
* Optional. Video height.
*
* @var int|null
*/
protected $height;
/**
* Optional. Video duration.
*
* @var int|null
*/
protected $duration;
/**
* Optional. Pass True, if the uploaded video is suitable for streaming.
*
* @var bool|null
*/
protected $supportsStreaming;
/**
* InputMediaVideo constructor.
*
* @param string $media
* @param string|null $caption
* @param string|null $parseMode
* @param int|null $width
* @param int|null $height
* @param int|null $duration
* @param bool $supportsStreaming
*/
public function __construct(
$media,
$caption = null,
$parseMode = null,
$width = null,
$height = null,
$duration = null,
$supportsStreaming = false
) {
$this->type = 'video';
$this->media = $media;
$this->caption = $caption;
$this->parseMode = $parseMode;
$this->width = $width;
$this->height = $height;
$this->duration = $duration;
$this->supportsStreaming = $supportsStreaming;
}
/**
* @return int|null
*/
public function getWidth()
{
return $this->width;
}
/**
* @param int|null $width
*
* @return void
*/
public function setWidth($width)
{
$this->width = $width;
}
/**
* @return int|null
*/
public function getHeight()
{
return $this->height;
}
/**
* @param int|null $height
*
* @return void
*/
public function setHeight($height)
{
$this->height = $height;
}
/**
* @return int|null
*/
public function getDuration()
{
return $this->duration;
}
/**
* @param int|null $duration
*
* @return void
*/
public function setDuration($duration)
{
$this->duration = $duration;
}
/**
* @return bool|null
*/
public function getSupportsStreaming()
{
return $this->supportsStreaming;
}
/**
* @param bool|null $supportsStreaming
*
* @return void
*/
public function setSupportsStreaming($supportsStreaming)
{
$this->supportsStreaming = $supportsStreaming;
}
}

198
vendor/telegram-bot/api/src/Types/Location.php vendored Executable file
View File

@@ -0,0 +1,198 @@
<?php
namespace TelegramBot\Api\Types;
use TelegramBot\Api\BaseType;
use TelegramBot\Api\InvalidArgumentException;
use TelegramBot\Api\TypeInterface;
/**
* Class Location
* This object represents a point on the map.
*
* @package TelegramBot\Api\Types
*/
class Location extends BaseType implements TypeInterface
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['latitude', 'longitude'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'latitude' => true,
'longitude' => true,
'horizontal_accuracy' => true,
'live_period' => true,
'heading' => true,
'proximity_alert_radius' => true,
];
/**
* Longitude as defined by sender
*
* @var float
*/
protected $longitude;
/**
* Latitude as defined by sender
*
* @var float
*/
protected $latitude;
/**
* Optional. The radius of uncertainty for the location, measured in meters; 0-1500
*
* @var float|null
*/
protected $horizontalAccuracy;
/**
* Optional. Time relative to the message sending date, during which the location can be updated, in seconds. For
* active live locations only.
*
* @var int|null
*/
protected $livePeriod;
/**
* Optional. The direction in which user is moving, in degrees; 1-360. For active live locations only.
*
* @var int|null
*/
protected $heading;
/**
* Optional. Maximum distance for proximity alerts about approaching another chat member, in meters. For sent live
* locations only.
*
* @var int|null
*/
protected $proximityAlertRadius;
/**
* @return float
*/
public function getLatitude()
{
return $this->latitude;
}
/**
* @param mixed $latitude
* @return void
* @throws InvalidArgumentException
*/
public function setLatitude($latitude)
{
if (is_float($latitude)) {
$this->latitude = $latitude;
} else {
throw new InvalidArgumentException();
}
}
/**
* @return float
*/
public function getLongitude()
{
return $this->longitude;
}
/**
* @param mixed $longitude
* @return void
* @throws InvalidArgumentException
*/
public function setLongitude($longitude)
{
if (is_float($longitude)) {
$this->longitude = $longitude;
} else {
throw new InvalidArgumentException();
}
}
/**
* @return float|null
*/
public function getHorizontalAccuracy()
{
return $this->horizontalAccuracy;
}
/**
* @param mixed $horizontalAccuracy
* @return void
* @throws InvalidArgumentException
*/
public function setHorizontalAccuracy($horizontalAccuracy)
{
if (is_float($horizontalAccuracy)) {
$this->horizontalAccuracy = $horizontalAccuracy;
} else {
throw new InvalidArgumentException();
}
}
/**
* @return int|null
*/
public function getLivePeriod()
{
return $this->livePeriod;
}
/**
* @param int $livePeriod
* @return void
*/
public function setLivePeriod($livePeriod)
{
$this->livePeriod = $livePeriod;
}
/**
* @return int|null
*/
public function getHeading()
{
return $this->heading;
}
/**
* @param int $heading
* @return void
*/
public function setHeading($heading)
{
$this->heading = $heading;
}
/**
* @return int|null
*/
public function getProximityAlertRadius()
{
return $this->proximityAlertRadius;
}
/**
* @param int $proximityAlertRadius
* @return void
*/
public function setProximityAlertRadius($proximityAlertRadius)
{
$this->proximityAlertRadius = $proximityAlertRadius;
}
}

126
vendor/telegram-bot/api/src/Types/LoginUrl.php vendored Executable file
View File

@@ -0,0 +1,126 @@
<?php
namespace TelegramBot\Api\Types;
use TelegramBot\Api\BaseType;
use TelegramBot\Api\TypeInterface;
/**
* This object represents a parameter of the inline keyboard button used to automatically authorize a user.
* Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram.
*/
class LoginUrl extends BaseType implements TypeInterface
{
/**
* @var array
*/
protected static $requiredParams = ['url'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'url' => true,
'forward_text' => true,
'bot_username' => true,
'request_write_access' => true
];
/**
* An HTTP URL to be opened with user authorization data added to the query string when the button is pressed.
*
* @var string
*/
protected $url;
/**
* Optional. New text of the button in forwarded messages.
*
* @var string|null
*/
protected $forwardText;
/**
* Optional. Username of a bot, which will be used for user authorization
*
* @var string|null
*/
protected $botUsername;
/**
* Optional. Pass True to request the permission for your bot to send messages to the user.
*
* @var bool|null
*/
protected $requestWriteAccess;
/**
* @return string
*/
public function getUrl()
{
return $this->url;
}
/**
* @param string $url
* @return void
*/
public function setUrl($url)
{
$this->url = $url;
}
/**
* @return null|string
*/
public function getForwardText()
{
return $this->forwardText;
}
/**
* @param string $forwardText
* @return void
*/
public function setForwardText($forwardText)
{
$this->forwardText = $forwardText;
}
/**
* @return null|string
*/
public function getBotUsername()
{
return $this->botUsername;
}
/**
* @param string $botUsername
* @return void
*/
public function setBotUsername($botUsername)
{
$this->botUsername = $botUsername;
}
/**
* @return bool|null
*/
public function isRequestWriteAccess()
{
return $this->requestWriteAccess;
}
/**
* @param bool $requestWriteAccess
* @return void
*/
public function setRequestWriteAccess($requestWriteAccess)
{
$this->requestWriteAccess = $requestWriteAccess;
}
}

View File

@@ -0,0 +1,123 @@
<?php
namespace TelegramBot\Api\Types;
use TelegramBot\Api\BaseType;
use TelegramBot\Api\TypeInterface;
/**
* Class MaskPosition
* This object describes the position on faces where a mask should be placed by default.
*
* @package TelegramBot\Api\Types
* @author bernard-ng <bernard@devscast.tech>
*/
class MaskPosition extends BaseType implements TypeInterface
{
protected static $requiredParams = ['point', 'x_shift', 'y_shift', 'scale'];
protected static $map = [
'point' => true,
'x_shift' => true,
'y_shift' => true,
'scale' => true,
];
/**
* The part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”.
*
* @var string
*/
protected $point;
/**
* Shift by X-axis measured in widths of the mask scaled to the face size, from left to right.
* For example, choosing -1.0 will place mask just to the left of the default mask position.
*
* @var float
*/
protected $xShift;
/**
* Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom.
* For example, 1.0 will place the mask just below the default mask position.
*
* @var float
*/
protected $yShift;
/**
* Mask scaling coefficient. For example, 2.0 means double size.
*
* @var float
*/
protected $scale;
/**
* @return string
*/
public function getPoint()
{
return $this->point;
}
/**
* @param string $point
* @return void
*/
public function setPoint($point)
{
$this->point = $point;
}
/**
* @return float
*/
public function getXShift()
{
return $this->xShift;
}
/**
* @param float $xShift
* @return void
*/
public function setXShift($xShift)
{
$this->xShift = $xShift;
}
/**
* @return float
*/
public function getYShift()
{
return $this->yShift;
}
/**
* @param float $yShift
* @return void
*/
public function setYShift($yShift)
{
$this->yShift = $yShift;
}
/**
* @return float
*/
public function getScale()
{
return $this->scale;
}
/**
* @param float $scale
* @return void
*/
public function setScale($scale)
{
$this->scale = $scale;
}
}

1367
vendor/telegram-bot/api/src/Types/Message.php vendored Executable file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,233 @@
<?php
/**
* Created by PhpStorm.
* User: iGusev
* Date: 13/04/16
* Time: 04:10
*/
namespace TelegramBot\Api\Types;
use TelegramBot\Api\BaseType;
use TelegramBot\Api\TypeInterface;
/**
* class MessageEntity.
* This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
*
* @package TelegramBot\Api\Types
*/
class MessageEntity extends BaseType implements TypeInterface
{
const TYPE_MENTION = 'mention';
const TYPE_HASHTAG = 'hashtag';
const TYPE_CASHTAG = 'cashtag';
const TYPE_BOT_COMMAND = 'bot_command';
const TYPE_URL = 'url';
const TYPE_EMAIL = 'email';
const TYPE_PHONE_NUMBER = 'phone_number';
const TYPE_BOLD = 'bold';
const TYPE_ITALIC = 'italic';
const TYPE_UNDERLINE = 'underline';
const TYPE_STRIKETHROUGH = 'strikethrough';
const TYPE_CODE = 'code';
const TYPE_PRE = 'pre';
const TYPE_TEXT_LINK = 'text_link';
const TYPE_TEXT_MENTION = 'text_mention';
const TYPE_CUSTOM_EMOJI = 'custom_emoji';
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['type', 'offset', 'length'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'type' => true,
'offset' => true,
'length' => true,
'url' => true,
'user' => User::class,
'language' => true,
'custom_emoji_id' => true,
];
/**
* Type of the entity.
* One of mention (@username), hashtag (#hashtag), cashtag ($USD), bot_command, url, email, phone_number,
* bold (bold text), italic (italic text), underline (underlined text), strikethrough (strikethrough text),
* code (monowidth string), pre (monowidth block), text_link (for clickable text URLs),
* text_mention (for users without usernames)
*
* @var string
*/
protected $type;
/**
* Offset in UTF-16 code units to the start of the entity
*
* @var int
*/
protected $offset;
/**
* Length of the entity in UTF-16 code units
*
* @var int
*/
protected $length;
/**
* Optional. For “text_link” only, url that will be opened after user taps on the text
*
* @var string|null
*/
protected $url;
/**
* Optional. For “text_mention” only, the mentioned user
*
* @var User|null
*/
protected $user;
/**
* Optional. For “pre” only, the programming language of the entity text
*
* @var string|null
*/
protected $language;
/**
* Optional. For “custom_emoji” only, unique identifier of the custom emoji.
* Use getCustomEmojiStickers to get full information about the sticker
*
* @var string|null
*/
protected $customEmojiId;
/**
* @return string
*/
public function getType()
{
return $this->type;
}
/**
* @param string $type
* @return void
*/
public function setType($type)
{
$this->type = $type;
}
/**
* @return int
*/
public function getOffset()
{
return $this->offset;
}
/**
* @param int $offset
* @return void
*/
public function setOffset($offset)
{
$this->offset = $offset;
}
/**
* @return int
*/
public function getLength()
{
return $this->length;
}
/**
* @param int $length
* @return void
*/
public function setLength($length)
{
$this->length = $length;
}
/**
* @return null|string
*/
public function getUrl()
{
return $this->url;
}
/**
* @param string $url
* @return void
*/
public function setUrl($url)
{
$this->url = $url;
}
/**
* @return User|null
*/
public function getUser()
{
return $this->user;
}
/**
* @param User $user
* @return void
*/
public function setUser($user)
{
$this->user = $user;
}
/**
* @return null|string
*/
public function getLanguage()
{
return $this->language;
}
/**
* @param string $language
* @return void
*/
public function setLanguage($language)
{
$this->language = $language;
}
/**
* @return null|string
*/
public function getCustomEmojiId()
{
return $this->customEmojiId;
}
/**
* @param string $customEmojiId
* @return void
*/
public function setCustomEmojiId($customEmojiId)
{
$this->customEmojiId = $customEmojiId;
}
}

View File

@@ -0,0 +1,52 @@
<?php
namespace TelegramBot\Api\Types;
use TelegramBot\Api\BaseType;
use TelegramBot\Api\TypeInterface;
/**
* This object represents a unique message identifier.
*/
class MessageId extends BaseType implements TypeInterface
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['message_id'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'message_id' => true,
];
/**
* Unique message identifier
*
* @var integer
*/
protected $messageId;
/**
* @return int
*/
public function getMessageId()
{
return $this->messageId;
}
/**
* @param int $messageId
* @return void
*/
public function setMessageId($messageId)
{
$this->messageId = $messageId;
}
}

View File

@@ -0,0 +1,20 @@
<?php
namespace TelegramBot\Api\Types\Payments;
abstract class ArrayOfLabeledPrice
{
/**
* @param array $data
* @return LabeledPrice[]
*/
public static function fromResponse($data)
{
$arrayOfLabeledPrice = [];
foreach ($data as $labeledPrice) {
$arrayOfLabeledPrice[] = LabeledPrice::fromResponse($labeledPrice);
}
return $arrayOfLabeledPrice;
}
}

View File

@@ -0,0 +1,170 @@
<?php
namespace TelegramBot\Api\Types\Payments;
use TelegramBot\Api\BaseType;
/**
* Class Invoice
* This object contains basic information about an invoice.
*
* @package TelegramBot\Api\Types\Payments
*/
class Invoice extends BaseType
{
/**
* @var array
*/
protected static $requiredParams = ['title', 'description', 'start_parameter', 'currency', 'total_amount'];
/**
* @var array
*/
protected static $map = [
'title' => true,
'description' => true,
'start_parameter' => true,
'currency' => true,
'total_amount' => true,
];
/**
* Product name
*
* @var string
*/
protected $title;
/**
* Product description
*
* @var string
*/
protected $description;
/**
* Unique bot deep-linking parameter that can be used to generate this invoice
*
* @var string
*/
protected $startParameter;
/**
* Three-letter ISO 4217 currency code
*
* @var string
*/
protected $currency;
/**
* Total price in the smallest units of the currency
*
* @var integer
*/
protected $totalAmount;
/**
* @author MY
* @return string
*/
public function getTitle()
{
return $this->title;
}
/**
* @author MY
*
* @param string $title
*
* @return void
*/
public function setTitle($title)
{
$this->title = $title;
}
/**
* @author MY
* @return string
*/
public function getDescription()
{
return $this->description;
}
/**
* @author MY
*
* @param string $description
*
* @return void
*/
public function setDescription($description)
{
$this->description = $description;
}
/**
* @author MY
* @return string
*/
public function getStartParameter()
{
return $this->startParameter;
}
/**
* @author MY
*
* @param string $startParameter
*
* @return void
*/
public function setStartParameter($startParameter)
{
$this->startParameter = $startParameter;
}
/**
* @author MY
* @return string
*/
public function getCurrency()
{
return $this->currency;
}
/**
* @author MY
*
* @param string $currency
*
* @return void
*/
public function setCurrency($currency)
{
$this->currency = $currency;
}
/**
* @author MY
* @return int
*/
public function getTotalAmount()
{
return $this->totalAmount;
}
/**
* @author MY
*
* @param int $totalAmount
*
* @return void
*/
public function setTotalAmount($totalAmount)
{
$this->totalAmount = $totalAmount;
}
}

View File

@@ -0,0 +1,77 @@
<?php
namespace TelegramBot\Api\Types\Payments;
use TelegramBot\Api\BaseType;
/**
* Class LabeledPrice
* This object represents a portion of the price for goods or services.
*
* @package TelegramBot\Api\Types\Payments
*/
class LabeledPrice extends BaseType
{
/**
* @var array
*/
protected static $requiredParams = ['label', 'amount'];
/**
* @var array
*/
protected static $map = [
'label' => true,
'amount' => true
];
/**
* Portion label
*
* @var string
*/
protected $label;
/**
* Price of the product in the smallest units of the currency (integer, not float/double).
*
* @var int
*/
protected $amount;
/**
* @return string
*/
public function getLabel()
{
return $this->label;
}
/**
* @param string $label
*
* @return void
*/
public function setLabel($label)
{
$this->label = $label;
}
/**
* @return int
*/
public function getAmount()
{
return $this->amount;
}
/**
* @param int $amount
*
* @return void
*/
public function setAmount($amount)
{
$this->amount = $amount;
}
}

View File

@@ -0,0 +1,145 @@
<?php
namespace TelegramBot\Api\Types\Payments;
use TelegramBot\Api\BaseType;
/**
* Class OrderInfo
* This object represents information about an order.
*
* @package TelegramBot\Api\Types\Payments
*/
class OrderInfo extends BaseType
{
/**
* @var array
*/
protected static $requiredParams = [];
/**
* @var array
*/
protected static $map = [
'name' => true,
'phone_number' => true,
'email' => true,
'shipping_address' => ShippingAddress::class
];
/**
* Optional. User name
*
* @var string|null
*/
protected $name;
/**
* Optional. User's phone number
*
* @var string|null
*/
protected $phoneNumber;
/**
* Optional. User email
*
* @var string|null
*/
protected $email;
/**
* Optional. User shipping address
*
* @var ShippingAddress|null
*/
protected $shippingAddress;
/**
* @author MY
*
* @return null|string
*/
public function getName()
{
return $this->name;
}
/**
* @author MY
*
* @param string $name
*
* @return void
*/
public function setName($name)
{
$this->name = $name;
}
/**
* @author MY
*
* @return null|string
*/
public function getPhoneNumber()
{
return $this->phoneNumber;
}
/**
* @author MY
*
* @param string $phoneNumber
*
* @return void
*/
public function setPhoneNumber($phoneNumber)
{
$this->phoneNumber = $phoneNumber;
}
/**
* @author MY
*
* @return null|string
*/
public function getEmail()
{
return $this->email;
}
/**
* @author MY
*
* @param string $email
*
* @return void
*/
public function setEmail($email)
{
$this->email = $email;
}
/**
* @author MY
*
* @return ShippingAddress|null
*/
public function getShippingAddress()
{
return $this->shippingAddress;
}
/**
* @author MY
*
* @param ShippingAddress $shippingAddress
*
* @return void
*/
public function setShippingAddress($shippingAddress)
{
$this->shippingAddress = $shippingAddress;
}
}

View File

@@ -0,0 +1,112 @@
<?php
namespace TelegramBot\Api\Types\Payments\Query;
use TelegramBot\Api\BaseType;
/**
* Class AnswerPreCheckoutQuery
* Use this method to respond to such pre-checkout queries.
*
* @package TelegramBot\Api\Types\Payments\Query
*/
class AnswerPreCheckoutQuery extends BaseType
{
/**
* @var array
*/
protected static $requiredParams = ['pre_checkout_query_id', 'ok'];
/**
* @var array
*/
protected static $map = [
'pre_checkout_query_id' => true,
'ok' => true,
'error_message' => true,
];
/**
* Unique identifier for the query to be answered
*
* @var string
*/
protected $preCheckoutQueryId;
/**
* Specify True if everything is alright
*
* @var bool
*/
protected $ok;
/**
* Error message in human readable form that explains the reason for failure to proceed with the checkout
*
* @var string
*/
protected $errorMessage;
/**
* @author MY
* @return bool
*/
public function getOk()
{
return $this->ok;
}
/**
* @author MY
*
* @param bool $ok
*
* @return void
*/
public function setOk($ok)
{
$this->ok = $ok;
}
/**
* @author MY
* @return string
*/
public function getErrorMessage()
{
return $this->errorMessage;
}
/**
* @author MY
*
* @param string $errorMessage
*
* @return void
*/
public function setErrorMessage($errorMessage)
{
$this->errorMessage = $errorMessage;
}
/**
* @author MY
* @return string
*/
public function getPreCheckoutQueryId()
{
return $this->preCheckoutQueryId;
}
/**
* @author MY
*
* @param string $preCheckoutQueryId
*
* @return void
*/
public function setPreCheckoutQueryId($preCheckoutQueryId)
{
$this->preCheckoutQueryId = $preCheckoutQueryId;
}
}

View File

@@ -0,0 +1,144 @@
<?php
namespace TelegramBot\Api\Types\Payments\Query;
use TelegramBot\Api\BaseType;
use TelegramBot\Api\Types\Payments\ArrayOfLabeledPrice;
/**
* Class AnswerShippingQuery
* If you sent an invoice requesting a shipping address and the parameter is_flexible was specified,
* the Bot API will send an Update with a shipping_query field to the bot
*
* @package TelegramBot\Api\Types\Payments\Query
*/
class AnswerShippingQuery extends BaseType
{
/**
* @var array
*/
protected static $requiredParams = ['shipping_query_id', 'ok'];
/**
* @var array
*/
protected static $map = [
'shipping_query_id' => true,
'ok' => true,
'shipping_options' => ArrayOfLabeledPrice::class,
'error_message' => true,
];
/**
* Unique identifier for the query to be answered
*
* @var string
*/
protected $shippingQueryId;
/**
* Specify True if delivery to the specified address is possible and False if there are any problems
*
* @var true
*/
protected $ok;
/**
* Required if ok is True. A JSON-serialized array of available shipping options.
*
* @var array
*/
protected $shippingOptions;
/**
* Required if ok is False. Error message in human readable form that explains why it is impossible to complete
* the order
*
* @var string
*/
protected $errorMessage;
/**
* @author MY
* @return string
*/
public function getShippingQueryId()
{
return $this->shippingQueryId;
}
/**
* @author MY
*
* @param string $shippingQueryId
*
* @return void
*/
public function setShippingQueryId($shippingQueryId)
{
$this->shippingQueryId = $shippingQueryId;
}
/**
* @author MY
* @return bool
*/
public function getOk()
{
return $this->ok;
}
/**
* @author MY
*
* @param true $ok
*
* @return void
*/
public function setOk($ok)
{
$this->ok = $ok;
}
/**
* @author MY
* @return array
*/
public function getShippingOptions()
{
return $this->shippingOptions;
}
/**
* @author MY
*
* @param array $shippingOptions
*
* @return void
*/
public function setShippingOptions($shippingOptions)
{
$this->shippingOptions = $shippingOptions;
}
/**
* @author MY
* @return string
*/
public function getErrorMessage()
{
return $this->errorMessage;
}
/**
* @author MY
*
* @param string $errorMessage
*
* @return void
*/
public function setErrorMessage($errorMessage)
{
$this->errorMessage = $errorMessage;
}
}

View File

@@ -0,0 +1,232 @@
<?php
namespace TelegramBot\Api\Types\Payments\Query;
use TelegramBot\Api\BaseType;
use TelegramBot\Api\Types\Payments\OrderInfo;
use TelegramBot\Api\Types\User;
/**
* Class PreCheckoutQuery
* This object contains information about an incoming pre-checkout query.
*
* @package TelegramBot\Api\Types\Payments\Query
*/
class PreCheckoutQuery extends BaseType
{
/**
* @var array
*/
protected static $requiredParams = ['id', 'from', 'currency', 'total_amount', 'invoice_payload'];
/**
* @var array
*/
protected static $map = [
'id' => true,
'from' => User::class,
'currency' => true,
'total_amount' => true,
'invoice_payload' => true,
'shipping_option_id' => true,
'order_info' => OrderInfo::class
];
/**
* Unique query identifier
*
* @var string
*/
protected $id;
/**
* User who sent the query
*
* @var User
*/
protected $from;
/**
* Three-letter ISO 4217 currency code
*
* @var string
*/
protected $currency;
/**
* Total price in the smallest units of the currency
*
* @var integer
*/
protected $totalAmount;
/**
* Bot specified invoice payload
*
* @var string
*/
protected $invoicePayload;
/**
* Optional. Identifier of the shipping option chosen by the user
*
* @var string|null
*/
protected $shippingOptionId;
/**
* Optional. Order info provided by the user
*
* @var OrderInfo|null
*/
protected $orderInfo;
/**
* @author MY
* @return string
*/
public function getId()
{
return $this->id;
}
/**
* @author MY
*
* @param string $id
*
* @return void
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @author MY
* @return User
*/
public function getFrom()
{
return $this->from;
}
/**
* @author MY
*
* @param User $from
*
* @return void
*/
public function setFrom($from)
{
$this->from = $from;
}
/**
* @author MY
* @return string
*/
public function getCurrency()
{
return $this->currency;
}
/**
* @author MY
*
* @param string $currency
*
* @return void
*/
public function setCurrency($currency)
{
$this->currency = $currency;
}
/**
* @author MY
* @return int
*/
public function getTotalAmount()
{
return $this->totalAmount;
}
/**
* @author MY
*
* @param int $totalAmount
*
* @return void
*/
public function setTotalAmount($totalAmount)
{
$this->totalAmount = $totalAmount;
}
/**
* @author MY
* @return mixed
*/
public function getInvoicePayload()
{
return $this->invoicePayload;
}
/**
* @author MY
*
* @param mixed $invoicePayload
*
* @return void
*/
public function setInvoicePayload($invoicePayload)
{
$this->invoicePayload = $invoicePayload;
}
/**
* @author MY
*
* @return null|string
*/
public function getShippingOptionId()
{
return $this->shippingOptionId;
}
/**
* @author MY
*
* @param string $shippingOptionId
*
* @return void
*/
public function setShippingOptionId($shippingOptionId)
{
$this->shippingOptionId = $shippingOptionId;
}
/**
* @author MY
*
* @return OrderInfo|null
*/
public function getOrderInfo()
{
return $this->orderInfo;
}
/**
* @author MY
*
* @param OrderInfo $orderInfo
*
* @return void
*/
public function setOrderInfo($orderInfo)
{
$this->orderInfo = $orderInfo;
}
}

View File

@@ -0,0 +1,145 @@
<?php
namespace TelegramBot\Api\Types\Payments\Query;
use TelegramBot\Api\BaseType;
use TelegramBot\Api\Types\Payments\ShippingAddress;
use TelegramBot\Api\Types\User;
/**
* Class ShippingQuery
* This object contains information about an incoming shipping query.
*
* @package TelegramBot\Api\Types\Payments\Query
*/
class ShippingQuery extends BaseType
{
/**
* @var array
*/
protected static $requiredParams = ['id', 'from', 'invoice_payload', 'shipping_address'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'id' => true,
'from' => User::class,
'invoice_payload' => true,
'shipping_address' => ShippingAddress::class
];
/**
* Unique query identifier
*
* @var string
*/
protected $id;
/**
* User who sent the query
*
* @var User
*/
protected $from;
/**
* Bot specified invoice payload
*
* @var string
*/
protected $invoicePayload;
/**
* User specified shipping address
*
* @var ShippingAddress
*/
protected $shippingAddress;
/**
* @author MY
* @return string
*/
public function getId()
{
return $this->id;
}
/**
* @author MY
*
* @param string $id
*
* @return void
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @author MY
* @return User
*/
public function getFrom()
{
return $this->from;
}
/**
* @author MY
*
* @param User $from
*
* @return void
*/
public function setFrom($from)
{
$this->from = $from;
}
/**
* @author MY
* @return string
*/
public function getInvoicePayload()
{
return $this->invoicePayload;
}
/**
* @author MY
*
* @param string $invoicePayload
*
* @return void
*/
public function setInvoicePayload($invoicePayload)
{
$this->invoicePayload = $invoicePayload;
}
/**
* @author MY
* @return ShippingAddress
*/
public function getShippingAddress()
{
return $this->shippingAddress;
}
/**
* @author MY
*
* @param ShippingAddress $shippingAddress
*
* @return void
*/
public function setShippingAddress($shippingAddress)
{
$this->shippingAddress = $shippingAddress;
}
}

View File

@@ -0,0 +1,199 @@
<?php
namespace TelegramBot\Api\Types\Payments;
use TelegramBot\Api\BaseType;
/**
* Class ShippingAddress
* This object represents a shipping address.
*
* @package TelegramBot\Api\Types\Payments
*/
class ShippingAddress extends BaseType
{
/**
* @var array
*/
protected static $requiredParams = ['country_code', 'state', 'city', 'street_line1', 'street_line2', 'post_code'];
/**
* @var array
*/
protected static $map = [
'country_code' => true,
'state' => true,
'city' => true,
'street_line1' => true,
'street_line2' => true,
'post_code' => true,
];
/**
* ISO 3166-1 alpha-2 country code
*
* @var string
*/
protected $countryCode;
/**
* State, if applicable
*
* @var string
*/
protected $state;
/**
* City
*
* @var string
*/
protected $city;
/**
* First line for the address
*
* @var string
*/
protected $streetLine1;
/**
* Second line for the address
*
* @var string
*/
protected $streetLine2;
/**
* Address post code
*
* @var string
*/
protected $postCode;
/**
* @author MY
* @return string
*/
public function getCountryCode()
{
return $this->countryCode;
}
/**
* @author MY
*
* @param string $countryCode
*
* @return void
*/
public function setCountryCode($countryCode)
{
$this->countryCode = $countryCode;
}
/**
* @author MY
* @return string
*/
public function getState()
{
return $this->state;
}
/**
* @author MY
*
* @param string $state
*
* @return void
*/
public function setState($state)
{
$this->state = $state;
}
/**
* @author MY
* @return string
*/
public function getCity()
{
return $this->city;
}
/**
* @author MY
*
* @param string $city
*
* @return void
*/
public function setCity($city)
{
$this->city = $city;
}
/**
* @author MY
* @return string
*/
public function getStreetLine1()
{
return $this->streetLine1;
}
/**
* @author MY
*
* @param string $streetLine1
*
* @return void
*/
public function setStreetLine1($streetLine1)
{
$this->streetLine1 = $streetLine1;
}
/**
* @author MY
* @return string
*/
public function getStreetLine2()
{
return $this->streetLine2;
}
/**
* @author MY
*
* @param string $streetLine2
*
* @return void
*/
public function setStreetLine2($streetLine2)
{
$this->streetLine2 = $streetLine2;
}
/**
* @author MY
* @return string
*/
public function getPostCode()
{
return $this->postCode;
}
/**
* @author MY
*
* @param string $postCode
*
* @return void
*/
public function setPostCode($postCode)
{
$this->postCode = $postCode;
}
}

View File

@@ -0,0 +1,112 @@
<?php
namespace TelegramBot\Api\Types\Payments;
use TelegramBot\Api\BaseType;
/**
* Class ShippingOption
* This object represents one shipping option.
*
* @package TelegramBot\Api\Types\Payments
*/
class ShippingOption extends BaseType
{
/**
* @var array
*/
protected static $requiredParams = ['id', 'title', 'prices'];
/**
* @var array
*/
protected static $map = [
'id' => true,
'title' => true,
'prices' => ArrayOfLabeledPrice::class
];
/**
* Shipping option identifier
*
* @var string
*/
protected $id;
/**
* Option title
*
* @var string
*/
protected $title;
/**
* List of price portions
*
* @var array
*/
protected $prices;
/**
* @author MY
* @return string
*/
public function getId()
{
return $this->id;
}
/**
* @author MY
*
* @param string $id
*
* @return void
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @author MY
* @return string
*/
public function getTitle()
{
return $this->title;
}
/**
* @author MY
*
* @param string $title
*
* @return void
*/
public function setTitle($title)
{
$this->title = $title;
}
/**
* @author MY
* @return array
*/
public function getPrices()
{
return $this->prices;
}
/**
* @author MY
*
* @param array $prices
*
* @return void
*/
public function setPrices($prices)
{
$this->prices = $prices;
}
}

View File

@@ -0,0 +1,236 @@
<?php
namespace TelegramBot\Api\Types\Payments;
use TelegramBot\Api\BaseType;
/**
* Class SuccessfulPayment
* This object contains basic information about a successful payment.
*
* @package TelegramBot\Api\Types\Payments
*/
class SuccessfulPayment extends BaseType
{
/**
* @var array
*/
protected static $requiredParams = [
'currency',
'total_amount',
'invoice_payload',
'telegram_payment_charge_id',
'provider_payment_charge_id'
];
/**
* @var array
*/
protected static $map = [
'currency' => true,
'total_amount' => true,
'invoice_payload' => true,
'shipping_option_id' => true,
'order_info' => OrderInfo::class,
'telegram_payment_charge_id' => true,
'provider_payment_charge_id' => true
];
/**
* Three-letter ISO 4217 currency code
*
* @var string
*/
protected $currency;
/**
* Total price in the smallest units of the currency
*
* @var integer
*/
protected $totalAmount;
/**
* Bot specified invoice payload
*
* @var array
*/
protected $invoicePayload;
/**
* Optional. Identifier of the shipping option chosen by the user
*
* @var string|null
*/
protected $shippingOptionId;
/**
* Optional. Order info provided by the user
*
* @var OrderInfo|null
*/
protected $orderInfo;
/**
* Telegram payment identifier
*
* @var string
*/
protected $telegramPaymentChargeId;
/**
* Provider payment identifier
*
* @var string
*/
protected $providerPaymentChargeId;
/**
* @author MY
* @return string
*/
public function getCurrency()
{
return $this->currency;
}
/**
* @author MY
*
* @param string $currency
*
* @return void
*/
public function setCurrency($currency)
{
$this->currency = $currency;
}
/**
* @author MY
* @return int
*/
public function getTotalAmount()
{
return $this->totalAmount;
}
/**
* @author MY
*
* @param int $totalAmount
*
* @return void
*/
public function setTotalAmount($totalAmount)
{
$this->totalAmount = $totalAmount;
}
/**
* @author MY
* @return array
*/
public function getInvoicePayload()
{
return $this->invoicePayload;
}
/**
* @author MY
*
* @param array $invoicePayload
*
* @return void
*/
public function setInvoicePayload($invoicePayload)
{
$this->invoicePayload = $invoicePayload;
}
/**
* @author MY
*
* @return null|string
*/
public function getShippingOptionId()
{
return $this->shippingOptionId;
}
/**
* @author MY
*
* @param string $shippingOptionId
*
* @return void
*/
public function setShippingOptionId($shippingOptionId)
{
$this->shippingOptionId = $shippingOptionId;
}
/**
* @author MY
* @return string
*/
public function getTelegramPaymentChargeId()
{
return $this->telegramPaymentChargeId;
}
/**
* @author MY
*
* @param string $telegramPaymentChargeId
*
* @return void
*/
public function setTelegramPaymentChargeId($telegramPaymentChargeId)
{
$this->telegramPaymentChargeId = $telegramPaymentChargeId;
}
/**
* @author MY
* @return mixed
*/
public function getProviderPaymentChargeId()
{
return $this->providerPaymentChargeId;
}
/**
* @author MY
*
* @param mixed $providerPaymentChargeId
*
* @return void
*/
public function setProviderPaymentChargeId($providerPaymentChargeId)
{
$this->providerPaymentChargeId = $providerPaymentChargeId;
}
/**
* @author MY
*
* @return OrderInfo|null
*/
public function getOrderInfo()
{
return $this->orderInfo;
}
/**
* @author MY
*
* @param OrderInfo $orderInfo
*
* @return void
*/
public function setOrderInfo($orderInfo)
{
$this->orderInfo = $orderInfo;
}
}

View File

@@ -0,0 +1,171 @@
<?php
namespace TelegramBot\Api\Types;
use TelegramBot\Api\BaseType;
use TelegramBot\Api\InvalidArgumentException;
use TelegramBot\Api\TypeInterface;
/**
* Class PhotoSize
* This object represents one size of a photo or a file / sticker thumbnail.
*
* @package TelegramBot\Api\Types
*/
class PhotoSize extends BaseType implements TypeInterface
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['file_id', 'file_unique_id', 'width', 'height'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'file_id' => true,
'file_unique_id' => true,
'width' => true,
'height' => true,
'file_size' => true,
];
/**
* Unique identifier for this file
*
* @var string
*/
protected $fileId;
/**
* Photo width
*
* @var int
*/
protected $width;
/**
* Photo height
*
* @var int
*/
protected $height;
/**
* Optional. File size
*
* @var int|null
*/
protected $fileSize;
/**
* Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
*
* @var string
*/
protected $fileUniqueId;
/**
* @return string
*/
public function getFileId()
{
return $this->fileId;
}
/**
* @param string $fileId
* @return void
*/
public function setFileId($fileId)
{
$this->fileId = $fileId;
}
/**
* @return int|null
*/
public function getFileSize()
{
return $this->fileSize;
}
/**
* @param mixed $fileSize
* @return void
* @throws InvalidArgumentException
*/
public function setFileSize($fileSize)
{
if (is_integer($fileSize)) {
$this->fileSize = $fileSize;
} else {
throw new InvalidArgumentException();
}
}
/**
* @return int
*/
public function getHeight()
{
return $this->height;
}
/**
* @param mixed $height
* @return void
* @throws InvalidArgumentException
*/
public function setHeight($height)
{
if (is_integer($height)) {
$this->height = $height;
} else {
throw new InvalidArgumentException();
}
}
/**
* @return int
*/
public function getWidth()
{
return $this->width;
}
/**
* @param mixed $width
* @return void
* @throws InvalidArgumentException
*/
public function setWidth($width)
{
if (is_integer($width)) {
$this->width = $width;
} else {
throw new InvalidArgumentException();
}
}
/**
* @return string
*/
public function getFileUniqueId()
{
return $this->fileUniqueId;
}
/**
* @param string $fileUniqueId
* @return void
*/
public function setFileUniqueId($fileUniqueId)
{
$this->fileUniqueId = $fileUniqueId;
}
}

267
vendor/telegram-bot/api/src/Types/Poll.php vendored Executable file
View File

@@ -0,0 +1,267 @@
<?php
namespace TelegramBot\Api\Types;
use TelegramBot\Api\BaseType;
use TelegramBot\Api\TypeInterface;
/**
* Class Poll
* This object contains information about a poll.
*
* @package TelegramBot\Api\Types
*/
class Poll extends BaseType implements TypeInterface
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = [
'id',
'question',
'options',
'total_voter_count',
'is_closed',
'is_anonymous',
'type',
'allows_multiple_answers',
];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'id' => true,
'question' => true,
'options' => ArrayOfPollOption::class,
'total_voter_count' => true,
'is_closed' => true,
'is_anonymous' => true,
'type' => true,
'allows_multiple_answers' => true,
'correct_option_id' => true,
];
/**
* Unique poll identifier
*
* @var string
*/
protected $id;
/**
* Poll question, 1-255 characters
*
* @var string
*/
protected $question;
/**
* List of poll options
* Array of \TelegramBot\Api\Types\PollOption
*
* @var array
*/
protected $options;
/**
* Total number of users that voted in the poll
*
* @var int
*/
protected $totalVoterCount;
/**
* True, if the poll is closed
*
* @var bool
*/
protected $isClosed;
/**
* True, if the poll is anonymous
*
* @var bool
*/
protected $isAnonymous;
/**
* Poll type, currently can be “regular” or “quiz”
*
* @var string
*/
protected $type;
/**
* True, if the poll allows multiple answers
*
* @var bool
*/
protected $allowsMultipleAnswers;
/**
* Optional. 0-based identifier of the correct answer option.
* Available only for polls in the quiz mode, which are closed, or was sent (not forwarded)
* by the bot or to the private chat with the bot.
*
* @var int|null
*/
protected $correctOptionId;
/**
* @return string
*/
public function getId()
{
return $this->id;
}
/**
* @param string $id
* @return void
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @return string
*/
public function getQuestion()
{
return $this->question;
}
/**
* @param string $question
* @return void
*/
public function setQuestion($question)
{
$this->question = $question;
}
/**
* @return array
*/
public function getOptions()
{
return $this->options;
}
/**
* @param array $options
* @return void
*/
public function setOptions($options)
{
$this->options = $options;
}
/**
* @return int
*/
public function getTotalVoterCount()
{
return $this->totalVoterCount;
}
/**
* @param int $totalVoterCount
* @return void
*/
public function setTotalVoterCount($totalVoterCount)
{
$this->totalVoterCount = $totalVoterCount;
}
/**
* @return bool
*/
public function isClosed()
{
return $this->isClosed;
}
/**
* @param bool $isClosed
* @return void
*/
public function setIsClosed($isClosed)
{
$this->isClosed = $isClosed;
}
/**
* @return bool
*/
public function isAnonymous()
{
return $this->isAnonymous;
}
/**
* @param bool $isAnonymous
* @return void
*/
public function setIsAnonymous($isAnonymous)
{
$this->isAnonymous = $isAnonymous;
}
/**
* @return string
*/
public function getType()
{
return $this->type;
}
/**
* @param string $type
* @return void
*/
public function setType($type)
{
$this->type = $type;
}
/**
* @return bool
*/
public function isAllowsMultipleAnswers()
{
return $this->allowsMultipleAnswers;
}
/**
* @param bool $allowsMultipleAnswers
* @return void
*/
public function setAllowsMultipleAnswers($allowsMultipleAnswers)
{
$this->allowsMultipleAnswers = $allowsMultipleAnswers;
}
/**
* @return int|null
*/
public function getCorrectOptionId()
{
return $this->correctOptionId;
}
/**
* @param int $correctOptionId
* @return void
*/
public function setCorrectOptionId($correctOptionId)
{
$this->correctOptionId = $correctOptionId;
}
}

View File

@@ -0,0 +1,114 @@
<?php
namespace TelegramBot\Api\Types;
use TelegramBot\Api\BaseType;
/**
* Class PollAnswer
*
* @see https://core.telegram.org/bots/api#pollanswer
*
* This object represents an answer of a user in a non-anonymous poll.
*
*
* @package TelegramBot\Api\Types
*/
class PollAnswer extends BaseType
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['poll_id', 'option_ids', 'user'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'option_ids' => true,
'user' => User::class,
'poll_id' => true,
];
/**
* @var \TelegramBot\Api\Types\User
*/
protected $user;
/**
* @var string
*/
protected $pollId;
/**
* @var int[]
*/
protected $optionIds;
/**
* @return string
*/
public function getPollId()
{
return $this->pollId;
}
/**
* @param string $id
* @return void
*/
public function setPollId($id)
{
$this->pollId = $id;
}
/**
* @return User
*/
public function getUser()
{
return $this->user;
}
/**
* @param User $from
* @return void
*/
public function setUser(User $from)
{
$this->user = $from;
}
/**
* @deprecated
*
* @return User
*/
public function getFrom()
{
@trigger_error(sprintf('Access user with %s is deprecated, use "%s::getUser" method', __METHOD__, __CLASS__), \E_USER_DEPRECATED);
return $this->getUser();
}
/**
* @return int[]
*/
public function getOptionIds()
{
return $this->optionIds;
}
/**
* @param int[] $optionIds
* @return void
*/
public function setOptionIds($optionIds)
{
$this->optionIds = $optionIds;
}
}

View File

@@ -0,0 +1,80 @@
<?php
namespace TelegramBot\Api\Types;
use TelegramBot\Api\BaseType;
use TelegramBot\Api\TypeInterface;
/**
* Class PollOption
* This object contains information about one answer option in a poll.
*
* @package TelegramBot\Api\Types
*/
class PollOption extends BaseType implements TypeInterface
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['text', 'voter_count'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'text' => true,
'voter_count' => true
];
/**
* Option text, 1-100 characters
*
* @var string
*/
protected $text;
/**
* Number of users that voted for this option
*
* @var integer
*/
protected $voterCount;
/**
* @return string
*/
public function getText()
{
return $this->text;
}
/**
* @param string $text
* @return void
*/
public function setText($text)
{
$this->text = $text;
}
/**
* @return int
*/
public function getVoterCount()
{
return $this->voterCount;
}
/**
* @param int $voterCount
* @return void
*/
public function setVoterCount($voterCount)
{
$this->voterCount = $voterCount;
}
}

View File

@@ -0,0 +1,97 @@
<?php
namespace TelegramBot\Api\Types;
use TelegramBot\Api\BaseType;
/**
* @deprecated Use ReplyKeyboardRemove
*
* Class ReplyKeyboardHide
* Upon receiving a message with this object, Telegram clients will hide the current custom keyboard
* and display the default letter-keyboard. By default, custom keyboards are displayed
* until a new keyboard is sent by a bot. An exception is made for one-time keyboards
* that are hidden immediately after the user presses a button (see \TelegramBot\Api\Types\ReplyKeyboardMarkup).
*
* @package TelegramBot\Api\Types
*/
class ReplyKeyboardHide extends BaseType
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['hide_keyboard'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'hide_keyboard' => true,
'selective' => true
];
/**
* Requests clients to hide the custom keyboard
*
* @var bool
*/
protected $hideKeyboard;
/**
* Optional. Use this parameter if you want to show the keyboard to specific users only.
* Targets:
* 1) users that are @mentioned in the text of the Message object;
* 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.
*
* @var bool|null
*/
protected $selective;
/**
* @param bool $hideKeyboard
* @param bool|null $selective
*/
public function __construct($hideKeyboard = true, $selective = null)
{
$this->hideKeyboard = $hideKeyboard;
$this->selective = $selective;
}
/**
* @return bool
*/
public function isHideKeyboard()
{
return $this->hideKeyboard;
}
/**
* @param bool $hideKeyboard
* @return void
*/
public function setHideKeyboard($hideKeyboard)
{
$this->hideKeyboard = $hideKeyboard;
}
/**
* @return bool|null
*/
public function isSelective()
{
return $this->selective;
}
/**
* @param bool $selective
* @return void
*/
public function setSelective($selective)
{
$this->selective = $selective;
}
}

View File

@@ -0,0 +1,204 @@
<?php
namespace TelegramBot\Api\Types;
use TelegramBot\Api\BaseType;
/**
* Class ReplyKeyboardMarkup
* This object represents a custom keyboard with reply options (see Introduction to bots for details and examples).
*
* @package TelegramBot\Api\Types
*/
class ReplyKeyboardMarkup extends BaseType
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['keyboard'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'keyboard' => true,
'one_time_keyboard' => true,
'resize_keyboard' => true,
'selective' => true,
'is_persistent' => true,
'input_field_placeholder' => true,
];
/**
* Array of button rows, each represented by an Array of Strings
* Array of Array of String
*
* @var array
*/
protected $keyboard;
/**
* Optional. Requests clients to resize the keyboard vertically for optimal fit
* (e.g., make the keyboard smaller if there are just two rows of buttons).
* Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard.
*
* @var bool|null
*/
protected $resizeKeyboard;
/**
* Optional. Requests clients to hide the keyboard as soon as it's been used. Defaults to false.
*
* @var bool|null
*/
protected $oneTimeKeyboard;
/**
* Optional. Use this parameter if you want to show the keyboard to specific users only.
* Targets:
* 1) users that are @mentioned in the text of the Message object;
* 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.
*
* @var bool|null
*/
protected $selective;
/**
* Optional. Requests clients to always show the keyboard when the regular keyboard is hidden.
* Defaults to false, in which case the custom keyboard can be hidden and opened with a keyboard icon.
*
* @var bool|null
*/
protected $isPersistent;
/**
* Optional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters
*
* @var string|null
*/
protected $inputFieldPlaceholder;
/**
* @param array $keyboard
* @param bool|null $oneTimeKeyboard
* @param bool|null $resizeKeyboard
* @param bool|null $selective
* @param bool|null $isPersistent
* @param string|null $inputFieldPlaceholder
*/
public function __construct($keyboard = [], $oneTimeKeyboard = null, $resizeKeyboard = null, $selective = null, $isPersistent = null, $inputFieldPlaceholder = null)
{
$this->keyboard = $keyboard;
$this->oneTimeKeyboard = $oneTimeKeyboard;
$this->resizeKeyboard = $resizeKeyboard;
$this->selective = $selective;
$this->isPersistent = $isPersistent;
$this->inputFieldPlaceholder = $inputFieldPlaceholder;
}
/**
* @return array
*/
public function getKeyboard()
{
return $this->keyboard;
}
/**
* @param array $keyboard
* @return void
*/
public function setKeyboard($keyboard)
{
$this->keyboard = $keyboard;
}
/**
* @return bool|null
*/
public function isOneTimeKeyboard()
{
return $this->oneTimeKeyboard;
}
/**
* @param bool $oneTimeKeyboard
* @return void
*/
public function setOneTimeKeyboard($oneTimeKeyboard)
{
$this->oneTimeKeyboard = $oneTimeKeyboard;
}
/**
* @return bool|null
*/
public function isResizeKeyboard()
{
return $this->resizeKeyboard;
}
/**
* @param bool $resizeKeyboard
* @return void
*/
public function setResizeKeyboard($resizeKeyboard)
{
$this->resizeKeyboard = $resizeKeyboard;
}
/**
* @return bool|null
*/
public function isSelective()
{
return $this->selective;
}
/**
* @param bool $selective
* @return void
*/
public function setSelective($selective)
{
$this->selective = $selective;
}
/**
* @return bool|null
*/
public function getIsPersistent()
{
return $this->isPersistent;
}
/**
* @param bool $isPersistent
* @return void
*/
public function setIsPersistent($isPersistent)
{
$this->isPersistent = $isPersistent;
}
/**
* @return string|null
*/
public function getInputFieldPlaceholder()
{
return $this->inputFieldPlaceholder;
}
/**
* @param string|null $inputFieldPlaceholder
* @return void
*/
public function setInputFieldPlaceholder($inputFieldPlaceholder)
{
$this->inputFieldPlaceholder = $inputFieldPlaceholder;
}
}

View File

@@ -0,0 +1,94 @@
<?php
namespace TelegramBot\Api\Types;
use TelegramBot\Api\BaseType;
/**
* Class ReplyKeyboardRemove
* Upon receiving a message with this object,
* Telegram clients will remove the current custom keyboard and display the default letter-keyboard.
*
* @package TelegramBot\Api\Types
*/
class ReplyKeyboardRemove extends BaseType
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = ['remove_keyboard'];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'remove_keyboard' => true,
'selective' => true
];
/**
* Requests clients to remove the custom keyboard (user will not be able to summon this keyboard;
* if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup)
*
* @var bool
*/
protected $removeKeyboard;
/**
* Optional. Use this parameter if you want to remove the keyboard for specific users only.
* Targets:
* 1) users that are @mentioned in the text of the Message object;
* 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.
*
* @var bool|null
*/
protected $selective;
/**
* @param bool $removeKeyboard
* @param bool $selective
*/
public function __construct($removeKeyboard = true, $selective = false)
{
$this->removeKeyboard = $removeKeyboard;
$this->selective = $selective;
}
/**
* @return bool
*/
public function getRemoveKeyboard()
{
return $this->removeKeyboard;
}
/**
* @param bool $removeKeyboard
* @return void
*/
public function setRemoveKeyboard($removeKeyboard)
{
$this->removeKeyboard = $removeKeyboard;
}
/**
* @return bool|null
*/
public function getSelective()
{
return $this->selective;
}
/**
* @param bool|null $selective
* @return void
*/
public function setSelective($selective)
{
$this->selective = $selective;
}
}

View File

@@ -0,0 +1,49 @@
<?php
namespace TelegramBot\Api\Types;
use TelegramBot\Api\BaseType;
use TelegramBot\Api\TypeInterface;
class SentWebAppMessage extends BaseType implements TypeInterface
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = [];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'inline_message_id' => true,
];
/**
* Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message.
*
* @var string|null
*/
protected $inlineMessageId;
/**
* @return string|null
*/
public function getInlineMessageId()
{
return $this->inlineMessageId;
}
/**
* @param string|null $inlineMessageId
* @return void
*/
public function setInlineMessageId($inlineMessageId)
{
$this->inlineMessageId = $inlineMessageId;
}
}

446
vendor/telegram-bot/api/src/Types/Sticker.php vendored Executable file
View File

@@ -0,0 +1,446 @@
<?php
namespace TelegramBot\Api\Types;
use TelegramBot\Api\BaseType;
use TelegramBot\Api\InvalidArgumentException;
use TelegramBot\Api\TypeInterface;
/**
* Class Sticker
* This object represents a sticker.
*
* @package TelegramBot\Api\Types
*/
class Sticker extends BaseType implements TypeInterface
{
/**
* {@inheritdoc}
*
* @var array
*/
protected static $requiredParams = [
'file_id',
'file_unique_id',
'type',
'width',
'height',
'is_animated',
'is_video'
];
/**
* {@inheritdoc}
*
* @var array
*/
protected static $map = [
'file_id' => true,
'file_unique_id' => true,
'type' => true,
'width' => true,
'height' => true,
'is_animated' => true,
'is_video' => true,
'thumbnail' => PhotoSize::class,
'file_size' => true,
'premium_animation' => File::class,
'emoji' => true,
'set_name' => true,
'mask_position' => MaskPosition::class,
'custom_emoji_id' => true,
];
/**
* Unique identifier for this file
*
* @var string
*/
protected $fileId;
/**
* Sticker width
*
* @var int
*/
protected $width;
/**
* Sticker height
*
* @var int
*/
protected $height;
/**
* Optional. Sticker thumbnail in the .WEBP or .JPG format
*
* @var PhotoSize|null
*/
protected $thumbnail;
/**
* Optional. File size
*
* @var int|null
*/
protected $fileSize;
/**
* Type of the sticker, currently one of “regular”, “mask”, “custom_emoji”.
* The type of the sticker is independent from its format,
* which is determined by the fields is_animated and is_video.
*
* @var string
*/
protected $type;
/**
* Unique identifier for this file, which is supposed to be the same over time and for different bots.
* Can't be used to download or reuse the file.
*
* @var string
*/
protected $fileUniqueId;
/**
* Optional. For premium regular stickers, premium animation for the sticker
*
* @var File|null
*/
protected $premiumAnimation;
/**
* True, if the sticker is animated
*
* @var bool
*/
protected $isAnimated;
/**
* True, if the sticker is a video sticker
*
* @var bool
*/
protected $isVideo;
/**
* Optional. Emoji associated with the sticker
*
* @var string|null
*/
protected $emoji;
/**
* Optional. Name of the sticker set to which the sticker belongs
*
* @var string|null
*/
protected $setName;
/**
* Optional. For mask stickers, the position where the mask should be placed
*
* @var MaskPosition|null
*/
protected $maskPosition;
/**
* Optional. For custom emoji stickers, unique identifier of the custom emoji
*
* @var string|null
*/
protected $customEmojiId;
/**
* @return string
*/
public function getFileId()
{
return $this->fileId;
}
/**
* @param string $fileId
*
* @return void
*/
public function setFileId($fileId)
{
$this->fileId = $fileId;
}
/**
* @return int|null
*/
public function getFileSize()
{
return $this->fileSize;
}
/**
* @param mixed $fileSize
*
* @throws InvalidArgumentException
*
* @return void
*/
public function setFileSize($fileSize)
{
if (is_integer($fileSize)) {
$this->fileSize = $fileSize;
} else {
throw new InvalidArgumentException();
}
}
/**
* @return int
*/
public function getHeight()
{
return $this->height;
}
/**
* @param mixed $height
*
* @throws InvalidArgumentException
*
* @return void
*/
public function setHeight($height)
{
if (is_integer($height)) {
$this->height = $height;
} else {
throw new InvalidArgumentException();
}
}
/**
* @return PhotoSize|null
*/
public function getThumbnail()
{
return $this->thumbnail;
}
/**
* @param PhotoSize $thumbnail
*
* @return void
*/
public function setThumbnail(PhotoSize $thumbnail)
{
$this->thumbnail = $thumbnail;
}
/**
* @deprecated use getThumbnail method
*
* @return PhotoSize|null
*/
public function getThumb()
{
return $this->getThumbnail();
}
/**
* @deprecated use setThumbnail method
*
* @param PhotoSize $thumb
*
* @return void
*/
public function setThumb($thumb)
{
$this->setThumbnail($thumb);
}
/**
* @return int
*/
public function getWidth()
{
return $this->width;
}
/**
* @param mixed $width
*
* @throws InvalidArgumentException
*
* @return void
*/
public function setWidth($width)
{
if (is_integer($width)) {
$this->width = $width;
} else {
throw new InvalidArgumentException();
}
}
/**
* @return string
*/
public function getType()
{
return $this->type;
}
/**
* @param string $type
*
* @return void
*/
public function setType($type)
{
$this->type = $type;
}
/**
* @return string
*/
public function getFileUniqueId()
{
return $this->fileUniqueId;
}
/**
* @param string $fileUniqueId
*
* @return void
*/
public function setFileUniqueId($fileUniqueId)
{
$this->fileUniqueId = $fileUniqueId;
}
/**
* @return File|null
*/
public function getPremiumAnimation()
{
return $this->premiumAnimation;
}
/**
* @param File $premiumAnimation
*
* @return void
*/
public function setPremiumAnimation(File $premiumAnimation)
{
$this->premiumAnimation = $premiumAnimation;
}
/**
* @return bool
*/
public function getIsAnimated()
{
return $this->isAnimated;
}
/**
* @param bool $isAnimated
*
* @return void
*/
public function setIsAnimated($isAnimated)
{
$this->isAnimated = $isAnimated;
}
/**
* @return bool
*/
public function getIsVideo()
{
return $this->isVideo;
}
/**
* @param bool $isVideo
*
* @return void
*/
public function setIsVideo($isVideo)
{
$this->isVideo = $isVideo;
}
/**
* @return null|string
*/
public function getEmoji()
{
return $this->emoji;
}
/**
* @param string $emoji
*
* @return void
*/
public function setEmoji($emoji)
{
$this->emoji = $emoji;
}
/**
* @return null|string
*/
public function getSetName()
{
return $this->setName;
}
/**
* @param string $setName
*
* @return void
*/
public function setSetName($setName)
{
$this->setName = $setName;
}
/**
* @return MaskPosition|null
*/
public function getMaskPosition()
{
return $this->maskPosition;
}
/**
* @param MaskPosition $maskPosition
*
* @return void
*/
public function setMaskPosition(MaskPosition $maskPosition)
{
$this->maskPosition = $maskPosition;
}
/**
* @return null|string
*/
public function getCustomEmojiId()
{
return $this->customEmojiId;
}
/**
* @param string $customEmojiId
*
* @return void
*/
public function setCustomEmojiId($customEmojiId)
{
$this->customEmojiId = $customEmojiId;
}
}

Some files were not shown because too many files have changed in this diff Show More