InlineQueryResultCachedSticker.php 995 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
<?php
/**
 * This file is part of the TelegramBot package.
 *
 * (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Longman\TelegramBot\Entities;

use Longman\TelegramBot\Exception\TelegramException;

class InlineQueryResultCachedSticker extends InlineQueryResult
{
    protected $sticker_file_id;

MBoretto's avatar
MBoretto committed
19 20 21 22 23
    /**
     * InlineQueryResultCachedSticker constructor.
     *
     * @param array $data
     */
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
    public function __construct(array $data)
    {
        parent::__construct($data);

        $this->type = 'sticker';

        $this->photo_file_id = isset($data['sticker_file_id']) ? $data['sticker_file_id'] : null;
        if (empty($this->sticker_file_id)) {
            throw new TelegramException('sticker_file_id is empty!');
        }
    }

    public function getStickerFileId()
    {
        return $this->sticker_file_id;
    }
}