Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

How to use MessageEntity? #131

Description

@tilonuz99

`<?php
use \unreal4u\TelegramAPI\Telegram\Types\Update;
use \React\EventLoop\Factory;
use \unreal4u\TelegramAPI\HttpClientRequestHandler;
use \unreal4u\TelegramAPI\TgLog;
use \unreal4u\TelegramAPI\Telegram\Methods\DeleteMessage;
use \unreal4u\TelegramAPI\Telegram\Methods\SendMessage;
use \unreal4u\TelegramAPI\Telegram\Types\MessageEntity;

$loop = Factory::create();
$tgLog = new TgLog("**********:AAFpSHsiJiUbzOnQuscxTAqnKdeH_MXuWl8", new HttpClientRequestHandler($loop));
$updateData = json_decode(file_get_contents('php://input'), true);
$update = new Update($updateData);
if ($update->message->text == '/start') {
$date = new MessageEntity();
$chat_id = $message->chat->id;
$sm = new SendMessage();
$sm->text = json_encode($date);
$sm->chat_id = $chat_id;
$tgLog->performApiRequest($sm);
$loop->run();
}`

{"type":"","offset":0,"length":0,"url":"","user":null}

i'm getting an empty type, but I need to get bot_command @unreal4u

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionMarks an PR or issue to be a question rather than code modification

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions