danog\MadelineProto\EventHandler
Author: Daniil Gentili daniil@daniil.it
Event handler.
Properties
$auth:\danog\MadelineProto\Namespace\Auth$account:\danog\MadelineProto\Namespace\Account$users:\danog\MadelineProto\Namespace\Users$contacts:\danog\MadelineProto\Namespace\Contacts$messages:\danog\MadelineProto\Namespace\Messages$updates:\danog\MadelineProto\Namespace\Updates$photos:\danog\MadelineProto\Namespace\Photos$upload:\danog\MadelineProto\Namespace\Upload$help:\danog\MadelineProto\Namespace\Help$channels:\danog\MadelineProto\Namespace\Channels$bots:\danog\MadelineProto\Namespace\Bots$payments:\danog\MadelineProto\Namespace\Payments$stickers:\danog\MadelineProto\Namespace\Stickers$phone:\danog\MadelineProto\Namespace\Phone$langpack:\danog\MadelineProto\Namespace\Langpack$folders:\danog\MadelineProto\Namespace\Folders$stats:\danog\MadelineProto\Namespace\Stats$chatlists:\danog\MadelineProto\Namespace\Chatlists$stories:\danog\MadelineProto\Namespace\Stories$premium:\danog\MadelineProto\Namespace\Premium$smsjobs:\danog\MadelineProto\Namespace\Smsjobs$fragment:\danog\MadelineProto\Namespace\Fragment
Method list:
startAndLoop(string $session, ?\danog\MadelineProto\SettingsAbstract $settings = NULL): voidstartAndLoopBot(string $session, string $token, ?\danog\MadelineProto\SettingsAbstract $settings = NULL): voidgetPeriodicLoop(string $name): ?\danog\Loop\PeriodicLoopgetPeriodicLoops(): array<string, \danog\Loop\PeriodicLoop>getReportPeers(): (string|int|array<(string|int)>)getPluginPaths(): (non-empty-string|non-empty-list<non-empty-string>|null)getPlugins(): array<class-string<\danog\MadelineProto\EventHandler>>MTProtoToBotAPI(array $data): arrayMTProtoToTd(mixed $params): arrayMTProtoToTdcli(mixed $params): arrayacceptCall(int $id, ?\Amp\Cancellation $cancellation = NULL): voidacceptSecretChat(array $params): voidarr(mixed ...$params): arraybase64urlDecode(string $data): stringbase64urlEncode(string $data): stringbotAPIToMTProto(array $arguments): arraybotLogin(string $token): ?arraybroadcastCustom(\danog\MadelineProto\Broadcast\Action $action, ?\danog\MadelineProto\Broadcast\Filter $filter = NULL, (float|null) $delay = NULL): intbroadcastForwardMessages(mixed $from_peer, list<int> $message_ids, bool $drop_author = false, ?\danog\MadelineProto\Broadcast\Filter $filter = NULL, bool $pin = false, (float|null) $delay = NULL): intbroadcastMessages(array $messages, ?\danog\MadelineProto\Broadcast\Filter $filter = NULL, bool $pin = false, (float|null) $delay = NULL): intcallFork(\Generator|\Amp\Future|callable $callable, mixed ...$args): \Amp\Future<T>callGetCurrent(int $id): \danog\MadelineProto\RemoteUrl|\danog\MadelineProto\LocalFile|string|nullcallPlay(int $id, \danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream $file): voidcallPlayOnHold(int $id, \danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream ...$files): voidcallSetOutput(int $id, \danog\MadelineProto\LocalFile|\Amp\ByteStream\WritableStream $file): voidcanConvertOgg(): boolcanUseFFmpeg(?\Amp\Cancellation $cancellation = NULL): boolcancelBroadcast(integer $id): voidcloseConnection(string $message): voidcomplete2faLogin(string $password): arraycompletePhoneLogin(string $code): arraycompleteSignup(string $first_name, string $last_name = ''): arraydiscardCall(int $id, \danog\MadelineProto\VoIP\DiscardReason $reason = \danog\MadelineProto\VoIP\DiscardReason::HANGUP, int<1, 5> $rating = NULL, string $comment = NULL): voiddiscardSecretChat(int $chat, bool $deleteHistory = false): voiddownloadServer(string $session): voiddownloadToBrowser((array|string|\danog\MadelineProto\FileCallbackInterface|\danog\MadelineProto\EventHandler\Message) $messageMedia, (null|callable) $cb = NULL, (null|int) $size = NULL, (null|string) $name = NULL, (null|string) $mime = NULL, ?\Amp\Cancellation $cancellation = NULL): voiddownloadToCallable(mixed $messageMedia, (callable|\danog\MadelineProto\FileCallbackInterface) $callable, callable $cb = NULL, bool $seekable = true, int $offset = 0, int $end = -1, int $part_size = NULL, ?\Amp\Cancellation $cancellation = NULL): voiddownloadToDir(mixed $messageMedia, (string|\danog\MadelineProto\FileCallbackInterface) $dir, callable $cb = NULL, ?\Amp\Cancellation $cancellation = NULL): non-empty-stringdownloadToFile(mixed $messageMedia, (string|\danog\MadelineProto\FileCallbackInterface) $file, callable $cb = NULL, ?\Amp\Cancellation $cancellation = NULL): non-empty-stringdownloadToResponse((array|string|\danog\MadelineProto\FileCallbackInterface|\danog\MadelineProto\EventHandler\Message) $messageMedia, \Amp\Http\Server\Request $request, callable $cb = NULL, (null|int) $size = NULL, (null|string) $mime = NULL, (null|string) $name = NULL, ?\Amp\Cancellation $cancellation = NULL): \Amp\Http\Server\ResponsedownloadToReturnedStream(mixed $messageMedia, callable $cb = NULL, int $offset = 0, int $end = -1, ?\Amp\Cancellation $cancellation = NULL): \Amp\ByteStream\ReadableStreamdownloadToStream(mixed $messageMedia, (mixed|\danog\MadelineProto\FileCallbackInterface|resource|\Amp\ByteStream\WritableStream) $stream, callable $cb = NULL, int $offset = 0, int $end = -1, ?\Amp\Cancellation $cancellation = NULL): voidecho(string $string): voidend(array<T> $what): TentitiesToHtml(string $message, list<(\danog\MadelineProto\EventHandler\Message\Entities\MessageEntity|array{_: string, offset: int, length: int})> $entities, bool $allowTelegramTags = false): stringexportAuthorization(): array{0: int, 1: string}extractBotAPIFile(array $info): ?arrayextractMessage(array $updates): arrayextractMessageId(array $updates): intextractMessageUpdate(array $updates): arrayextractUpdates(array $updates): array<array>fileGetContents(string $url, ?\Amp\Cancellation $cancellation = NULL): stringflock(string $file, integer $operation, float $polling = 0.1, ?\Amp\Cancellation $token = NULL, ?\Closure $failureCb = NULL): ($token is null ? Closure(): void : (Closure(): void | null))fullChatLastUpdated(mixed $id): intfullGetSelf(): array|falsegenVectorHash(array<(string|int)> $longs): stringgetAdminIds(): arraygetAllCalls(): array<int, \danog\MadelineProto\VoIP>getAllMethods(): arraygetAuthorization(): (\danog\MadelineProto\API::NOT_LOGGED_IN|\danog\MadelineProto\API::WAITING_CODE|\danog\MadelineProto\API::WAITING_SIGNUP|\danog\MadelineProto\API::WAITING_PASSWORD|\danog\MadelineProto\API::LOGGED_IN|API::LOGGED_OUT)getBroadcastProgress(integer $id): ?\danog\MadelineProto\Broadcast\ProgressgetCachedConfig(): arraygetCall(int $id): ?\danog\MadelineProto\VoIPgetCallByPeer(int $userId): ?\danog\MadelineProto\VoIPgetCallState(int $id): ?\danog\MadelineProto\VoIP\CallStategetCdnConfig(): voidgetConfig(array $config = []): arraygetDNSClient(): \Amp\Dns\DnsResolvergetDhConfig(?\Amp\Cancellation $cancellation = NULL): arraygetDialogIds(): list<int>getDownloadInfo(mixed $messageMedia): array{ext: string, name: string, mime: string, size: int, InputFileLocation: array, key_fingerprint?: string, key?: string, iv?: string, thumb_size?: string}getDownloadLink(\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|array|string $media, ?string $scriptUrl = NULL, ?int $size = NULL, ?string $name = NULL, ?string $mime = NULL): stringgetEventHandler((class-string<T>|null) $class = NULL): (T|\danog\MadelineProto\Ipc\EventHandlerProxy|\__PHP_Incomplete_Class|null)getExtensionFromLocation(mixed $location, string $default): stringgetExtensionFromMime(string $mime): stringgetFileInfo(mixed $constructor): arraygetFullDialogs(): array<int, array>getFullInfo(mixed $id): arraygetHTTPClient(): \Amp\Http\Client\HttpClientgetHint(): stringgetId(mixed $id): intgetInfo(mixed $id, \danog\MadelineProto\API::INFO_TYPE_* $type = \danog\MadelineProto\API::INFO_TYPE_ALL): (\$type is \danog\MadelineProto\API::INFO_TYPE_ALL ? array{User?: array, Chat?: array, bot_api_id: int, user_id?: int, chat_id?: int, channel_id?: int, type: string} : ($type is API::INFO_TYPE_TYPE ? string : ($type is \danog\MadelineProto\API::INFO_TYPE_ID ? int : (array{_: string, user_id?: int, access_hash?: int, min?: bool, chat_id?: int, channel_id?: int} | array{_: string, user_id?: int, access_hash?: int, min?: bool} | array{_: string, channel_id: int, access_hash: int, min: bool}))))getLogger(): \danog\MadelineProto\LoggergetMaps(): ?intgetMaxMaps(): ?intgetMemoryProfile(): stringgetMethodNamespaces(): arraygetMethodsNamespaced(): arraygetMimeFromBuffer(string $buffer): stringgetMimeFromExtension(string $extension, string $default): stringgetMimeFromFile(string $file): stringgetPlugin(class-string<T> $class): \danog\MadelineProto\PluginEventHandler|\danog\MadelineProto\Ipc\EventHandlerProxy|nullgetPromCounter(string $namespace, string $name, string $help, array<string, string> $labels = []): ?\danog\BetterPrometheus\BetterCountergetPromGauge(string $namespace, string $name, string $help, array<string, string> $labels = []): ?\danog\BetterPrometheus\BetterGaugegetPromHistogram(string $namespace, string $name, string $help, array<string, string> $labels = [], ?non-empty-list<float> $buckets = NULL): ?\danog\BetterPrometheus\BetterHistogramgetPromSummary(string $namespace, string $name, string $help, array<string, string> $labels = [], int $maxAgeSeconds = 600, ?non-empty-list<float> $quantiles = NULL): ?\danog\BetterPrometheus\BetterSummarygetPropicInfo(mixed $data): ?\danog\MadelineProto\EventHandler\Media\PhotogetPsrLogger(): \Psr\Log\LoggerInterfacegetPwrChat(mixed $id, bool $fullfetch = true): arraygetSecretChat((array|int) $chat): \danog\MadelineProto\SecretChats\SecretChatgetSecretMessage(integer $chatId, integer $randomId): \danog\MadelineProto\EventHandler\Message\SecretMessagegetSelf(): array|falsegetSessionName(): stringgetSettings(): \danog\MadelineProto\SettingsgetSponsoredMessages((int|string|array) $peer): ?arraygetStream(\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream $stream, ?\Amp\Cancellation $cancellation = NULL, ?int $size = NULL): \Amp\ByteStream\ReadableStreamgetStreamPipe(): \Amp\ByteStream\PipegetTL(): \danog\MadelineProto\TL\TLInterfacegetType(mixed $id): \danog\MadelineProto\API::PEER_TYPE_*getUpdates(array{offset?: int, limit?: int, timeout?: float} $params = []): list<array{update_id: mixed, update: mixed}>getWebMessage(string $message): stringgetWebWarnings(): stringhasAdmins(): boolhasEventHandler(): boolhasPlugin(class-string<\danog\MadelineProto\EventHandler> $class): boolhasReportPeers(): boolhasSecretChat((array|int) $chat): boolhtmlEscape(string $what): stringhtmlToMessageEntities(string $html): \danog\MadelineProto\TextEntitiesimportAuthorization(array<int, string> $authorization, int $mainDcID): arrayinflateStripped(string $stripped): stringinitSelfRestart(): voidisAltervista(): boolisArrayOrAlike(mixed $var): boolisBot(mixed $peer): boolisForum(mixed $peer): boolisIpc(): boolisIpcWorker(): boolisPlayPaused(int $id): boolisPremium(): boolisSelfBot(): boolisSelfUser(): boolisTestMode(): booleanlogger(mixed $param, int $level = \danog\MadelineProto\Logger::NOTICE, string $file = ''): voidlogout(): voidmarkdownCodeEscape(string $what): stringmarkdownCodeblockEscape(string $what): stringmarkdownEscape(string $what): stringmarkdownToMessageEntities(string $markdown): \danog\MadelineProto\TextEntitiesmarkdownUrlEscape(string $what): stringmbStrSplit(string $text, integer $length): array<string>mbStrlen(string $text): intmbSubstr(string $text, integer $offset, (null|int) $length = NULL): stringopenBuffered(\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream $stream, ?\Amp\Cancellation $cancellation = NULL): Closure(int): ?stringopenFileAppendOnly(string $path): \Amp\File\FilepackDouble(float $value): stringpackSignedInt(integer $value): stringpackSignedLong(int $value): stringpackUnsignedInt(int $value): stringpausePlay(int $id): voidpeerIsset(mixed $id): boolphoneLogin(string $number, integer $sms_type = 5): arrayposmod(int $a, int $b): intprocessDownloadServerPing(string $path, string $payload): voidqrLogin(): ?\danog\MadelineProto\TL\Types\LoginQrCoderandom(integer $length): stringrandomInt(integer $modulus = 0): intreadLine(string $prompt = '', ?\Amp\Cancellation $cancel = NULL): stringrefreshFullPeerCache(mixed $id): voidrefreshPeerCache(mixed ...$ids): voidrenderPromStats(?\Prometheus\RendererInterface $renderer = NULL): stringreport(string $message, string $parseMode = ''): voidreportMemoryProfile(): voidrequestCall(mixed $user): \danog\MadelineProto\VoIPrequestSecretChat(mixed $user): intresetUpdateState(): voidrestart(): voidresumePlay(int $id): voidrethrow(Throwable $e): voidrleDecode(string $string): stringrleEncode(string $string): stringsendAudio((integer|string) $peer, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream) $file, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream|null) $thumb = NULL, string $caption = '', \danog\MadelineProto\ParseMode $parseMode = \danog\MadelineProto\ParseMode::TEXT, ?callable $callback = NULL, ?string $fileName = NULL, ?string $mimeType = NULL, (integer|null) $duration = NULL, (string|null) $title = NULL, (string|null) $performer = NULL, ?int $ttl = NULL, (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|string|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, boolean $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $forceResend = false, ?\Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\MessagesendCustomEvent(mixed $payload): voidsendDocument((integer|string) $peer, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream) $file, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream|null) $thumb = NULL, string $caption = '', \danog\MadelineProto\ParseMode $parseMode = \danog\MadelineProto\ParseMode::TEXT, ?callable $callback = NULL, ?string $fileName = NULL, ?string $mimeType = NULL, ?int $ttl = NULL, bool $spoiler = false, (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, bool $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $updateStickersetsOrder = false, boolean $forceResend = false, \Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\MessagesendDocumentPhoto((integer|string) $peer, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream) $file, string $caption = '', \danog\MadelineProto\ParseMode $parseMode = \danog\MadelineProto\ParseMode::TEXT, ?callable $callback = NULL, ?string $fileName = NULL, ?int $ttl = NULL, bool $spoiler = false, (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, bool $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $updateStickersetsOrder = false, boolean $forceResend = false, \Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\MessagesendGif((integer|string) $peer, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream) $file, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream|null) $thumb = NULL, string $caption = '', \danog\MadelineProto\ParseMode $parseMode = \danog\MadelineProto\ParseMode::TEXT, ?callable $callback = NULL, ?string $fileName = NULL, (integer|null) $ttl = NULL, boolean $spoiler = false, ?int $duration = NULL, ?int $width = NULL, ?int $height = NULL, string $thumbSeek = '00:00:01.000', (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|string|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, boolean $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $forceResend = false, ?\Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\MessagesendMessage((integer|string) $peer, string $message, \danog\MadelineProto\ParseMode $parseMode = \danog\MadelineProto\ParseMode::TEXT, (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, bool $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $noWebpage = false, boolean $updateStickersetsOrder = false, ?\Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\MessagesendMessageToAdmins(string $message, \danog\MadelineProto\ParseMode $parseMode = \danog\MadelineProto\ParseMode::TEXT, (array|null) $replyMarkup = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, bool $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $noWebpage = false, ?\Amp\Cancellation $cancellation = NULL): list<\danog\MadelineProto\EventHandler\Message>sendPhoto((integer|string) $peer, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream) $file, string $caption = '', \danog\MadelineProto\ParseMode $parseMode = \danog\MadelineProto\ParseMode::TEXT, ?callable $callback = NULL, ?string $fileName = NULL, ?int $ttl = NULL, bool $spoiler = false, (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, bool $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $updateStickersetsOrder = false, boolean $forceResend = false, \Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\MessagesendSticker((integer|string) $peer, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream) $file, string $mimeType, string $emoji = '', array $stickerSet = [ '_' => 'inputStickerSetEmpty',], ?callable $callback = NULL, ?string $fileName = NULL, ?int $ttl = NULL, (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, boolean $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $updateStickersetsOrder = false, boolean $forceResend = false, \Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\MessagesendVideo((integer|string) $peer, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream) $file, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream|null) $thumb = NULL, string $caption = '', \danog\MadelineProto\ParseMode $parseMode = \danog\MadelineProto\ParseMode::TEXT, ?callable $callback = NULL, ?string $fileName = NULL, string $mimeType = 'video/mp4', (integer|null) $ttl = NULL, boolean $spoiler = false, boolean $roundMessage = false, boolean $supportsStreaming = true, boolean $noSound = false, (integer|null) $duration = NULL, (integer|null) $width = NULL, (integer|null) $height = NULL, string $thumbSeek = '00:00:01.000', (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|string|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, boolean $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $forceResend = false, bool $updateStickersetsOrder = false, \Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\MessagesendVoice((integer|string) $peer, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream) $file, string $caption = '', \danog\MadelineProto\ParseMode $parseMode = \danog\MadelineProto\ParseMode::TEXT, ?callable $callback = NULL, ?string $fileName = NULL, (integer|null) $ttl = NULL, (integer|null) $duration = NULL, (array|null) $waveform = NULL, (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|string|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, boolean $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $forceResend = false, ?\Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\MessagesetNoop(): voidsetReportPeers((int|string|array<(int|string)>) $userOrId): voidsetWebhook(string $webhookUrl): voidskipPlay(int $id): voidsleep(float $time): voidstart(): arraystop(): voidstopPlay(int $id): voidstringToStream(string $str): \Amp\ByteStream\ReadableBuffersubscribeToUpdates(mixed $channel): booltdToMTProto(array $params): arraytdToTdcli(mixed $params): arraytdcliToTd(mixed $params, array $key = NULL): arraytestFibers(int $fiberCount = 100000): array{maxFibers: int, realMemoryMb: int, maps: ?int, maxMaps: ?int}toCamelCase(string $input): stringtoSnakeCase(string $input): stringunpackDouble(string $value): floatunpackFileId(string $fileId): arrayunpackSignedInt(string $value): intunpackSignedLong(string $value): intunpackSignedLongString((string|int|array) $value): stringunsetEventHandler(): voidupdate2fa(array{password?: string, new_password?: string, email?: string, hint?: string} $params): voidupdateSettings(\danog\MadelineProto\SettingsAbstract $settings): voidupload((\danog\MadelineProto\FileCallbackInterface|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream|string|array|resource) $file, string $fileName = '', callable $cb = NULL, boolean $encrypted = false, ?\Amp\Cancellation $cancellation = NULL): arrayuploadAudio((\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream) $file, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream|null) $thumb = NULL, (integer|string|null) $peer = NULL, string $caption = '', \danog\MadelineProto\ParseMode $parseMode = \danog\MadelineProto\ParseMode::TEXT, ?callable $callback = NULL, ?string $fileName = NULL, ?string $mimeType = NULL, (integer|null) $duration = NULL, (string|null) $title = NULL, (string|null) $performer = NULL, ?int $ttl = NULL, (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|string|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, boolean $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $forceResend = false, ?\Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\MediauploadDocument((\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream) $file, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream|null) $thumb = NULL, (integer|string|null) $peer = NULL, string $caption = '', \danog\MadelineProto\ParseMode $parseMode = \danog\MadelineProto\ParseMode::TEXT, ?callable $callback = NULL, ?string $fileName = NULL, ?string $mimeType = NULL, ?int $ttl = NULL, bool $spoiler = false, (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, bool $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $updateStickersetsOrder = false, boolean $forceResend = false, \Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\MediauploadDocumentPhoto((\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream) $file, (integer|string|null) $peer = NULL, string $caption = '', \danog\MadelineProto\ParseMode $parseMode = \danog\MadelineProto\ParseMode::TEXT, ?callable $callback = NULL, ?string $fileName = NULL, ?int $ttl = NULL, bool $spoiler = false, (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, bool $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $updateStickersetsOrder = false, boolean $forceResend = false, \Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\MediauploadEncrypted((\danog\MadelineProto\FileCallbackInterface|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|string|array|resource) $file, string $fileName = '', callable $cb = NULL, ?\Amp\Cancellation $cancellation = NULL): arrayuploadFromCallable(callable(int, int, ?Cancellation): strin) $callable, integer $size = 0, ?string $mime = NULL, string $fileName = '', callable(float, float, float): voi) $cb = NULL, boolean $seekable = true, boolean $encrypted = false, ?\Amp\Cancellation $cancellation = NULL): arrayuploadFromStream(mixed $stream, integer $size = 0, string $mime = NULL, string $fileName = '', callable $cb = NULL, boolean $encrypted = false, ?\Amp\Cancellation $cancellation = NULL): arrayuploadFromTgfile(mixed $media, callable $cb = NULL, boolean $encrypted = false, ?\Amp\Cancellation $cancellation = NULL): arrayuploadFromUrl((string|\danog\MadelineProto\FileCallbackInterface) $url, integer $size = 0, string $fileName = '', callable $cb = NULL, boolean $encrypted = false, ?\Amp\Cancellation $cancellation = NULL): arrayuploadGif((\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream) $file, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream|null) $thumb = NULL, (integer|string|null) $peer = NULL, string $caption = '', \danog\MadelineProto\ParseMode $parseMode = \danog\MadelineProto\ParseMode::TEXT, ?callable $callback = NULL, ?string $fileName = NULL, (integer|null) $ttl = NULL, boolean $spoiler = false, ?int $duration = NULL, ?int $width = NULL, ?int $height = NULL, string $thumbSeek = '00:00:01.000', (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|string|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, boolean $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $forceResend = false, ?\Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\MediauploadPhoto((\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream) $file, (integer|string|null) $peer = NULL, string $caption = '', \danog\MadelineProto\ParseMode $parseMode = \danog\MadelineProto\ParseMode::TEXT, ?callable $callback = NULL, ?string $fileName = NULL, ?int $ttl = NULL, bool $spoiler = false, (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, bool $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $updateStickersetsOrder = false, boolean $forceResend = false, \Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\MediauploadSticker((\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream) $file, string $mimeType, (integer|string|null) $peer = NULL, string $emoji = '', array $stickerSet = [ '_' => 'inputStickerSetEmpty',], ?callable $callback = NULL, ?string $fileName = NULL, ?int $ttl = NULL, (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, boolean $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $updateStickersetsOrder = false, boolean $forceResend = false, \Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\MediauploadVideo((\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream) $file, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream|null) $thumb = NULL, (integer|string|null) $peer = NULL, string $caption = '', \danog\MadelineProto\ParseMode $parseMode = \danog\MadelineProto\ParseMode::TEXT, ?callable $callback = NULL, ?string $fileName = NULL, string $mimeType = 'video/mp4', (integer|null) $ttl = NULL, boolean $spoiler = false, boolean $roundMessage = false, boolean $supportsStreaming = true, boolean $noSound = false, (integer|null) $duration = NULL, (integer|null) $width = NULL, (integer|null) $height = NULL, string $thumbSeek = '00:00:01.000', (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|string|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, boolean $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $forceResend = false, bool $updateStickersetsOrder = false, \Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\MediauploadVoice((integer|string|null) $peer, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream) $file, string $caption = '', \danog\MadelineProto\ParseMode $parseMode = \danog\MadelineProto\ParseMode::TEXT, ?callable $callback = NULL, ?string $fileName = NULL, (integer|null) $ttl = NULL, (integer|null) $duration = NULL, (array|null) $waveform = NULL, (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|string|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, boolean $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $forceResend = false, ?\Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\MediavalidateEventHandlerClass(class-string<\danog\MadelineProto\EventHandler> $class): list<\danog\MadelineProto\EventHandlerIssue>viewSponsoredMessage((int|array) $peer, (string|array{random_id: string}) $message): boolwrapMedia(array $media, bool $protected = false): ?\danog\MadelineProto\EventHandler\MediawrapMessage(array $message, bool $scheduled = false): ?\danog\MadelineProto\EventHandler\AbstractMessagewrapPin(array $message): ?\danog\MadelineProto\EventHandler\PinnedwrapUpdate(array $update): ?\danog\MadelineProto\EventHandler\UpdateinitDbProperties(\danog\AsyncOrm\Settings $settings, string $tablePrefix): voidsaveDbProperties(): void
Methods:
startAndLoop(string $session, ?\danog\MadelineProto\SettingsAbstract $settings = NULL): void
Start MadelineProto and the event handler.
Also initializes error reporting, catching and reporting all errors surfacing from the event loop.
Parameters:
$session:stringSession name$settings:?\danog\MadelineProto\SettingsAbstractSettings
See also:
\danog\MadelineProto\SettingsAbstract
startAndLoopBot(string $session, string $token, ?\danog\MadelineProto\SettingsAbstract $settings = NULL): void
Start MadelineProto as a bot and the event handler.
Also initializes error reporting, catching and reporting all errors surfacing from the event loop.
Parameters:
$session:stringSession name$token:stringBot token$settings:?\danog\MadelineProto\SettingsAbstractSettings
See also:
\danog\MadelineProto\SettingsAbstract
getPeriodicLoop(string $name): ?\danog\Loop\PeriodicLoop
Obtain a PeriodicLoop instance created by the Cron attribute.
Parameters:
$name:stringMethod name
See also:
\danog\Loop\PeriodicLoop
getPeriodicLoops(): array<string, \danog\Loop\PeriodicLoop>
Obtain all PeriodicLoop instances created by the Cron attribute.
See also:
\danog\Loop\PeriodicLoop
getReportPeers(): (string|int|array<(string|int)>)
Get peers where to send error reports.
getPluginPaths(): (non-empty-string|non-empty-list<non-empty-string>|null)
Obtain a path or a list of paths that will be recursively searched for plugins.
Plugin filenames end with Plugin.php, and will be included automatically.
See also:
non-empty-stringnon-empty-list
getPlugins(): array<class-string<\danog\MadelineProto\EventHandler>>
Obtain a list of plugin event handlers to use, in addition with those found by getPluginPath.
MTProtoToBotAPI(array $data): array
Convert MTProto parameters to bot API parameters.
Parameters:
$data:arrayData
MTProtoToTd(mixed $params): array
MTProto to TD params.
Parameters:
$params:mixedParams
MTProtoToTdcli(mixed $params): array
MTProto to TDCLI params.
Parameters:
$params:mixedParams
acceptCall(int $id, ?\Amp\Cancellation $cancellation = NULL): void
Accept call.
Parameters:
$id:int$cancellation:?\Amp\Cancellation
See also:
\Amp\Cancellation
acceptSecretChat(array $params): void
Accept secret chat.
Parameters:
$params:arraySecret chat ID
arr(mixed ...$params): array
Create array.
Parameters:
...$params:mixedParams
base64urlDecode(string $data): string
base64URL decode.
Parameters:
$data:stringData to decode
base64urlEncode(string $data): string
Base64URL encode.
Parameters:
$data:stringData to encode
botAPIToMTProto(array $arguments): array
Convert bot API parameters to MTProto parameters.
Parameters:
$arguments:arrayArguments
botLogin(string $token): ?array
Login as bot.
Parameters:
$token:stringBot token
broadcastCustom(\danog\MadelineProto\Broadcast\Action $action, ?\danog\MadelineProto\Broadcast\Filter $filter = NULL, (float|null) $delay = NULL): int
Executes a custom broadcast action with all peers (users, chats, channels) of the bot.
Will return an integer ID that can be used to:
- Get the current broadcast progress with getBroadcastProgress
- Cancel the broadcast using cancelBroadcast
Note that to avoid manually polling the progress,
MadelineProto will also periodically emit updateBroadcastProgress updates,
containing a Progress object for all broadcasts currently in-progress.
Parameters:
$action:\danog\MadelineProto\Broadcast\ActionA custom, serializable Action class that will be called once for every peer.$filter:?\danog\MadelineProto\Broadcast\Filter$delay:(float|null)Number of seconds to wait between each peer.
See also:
\danog\MadelineProto\Broadcast\Action: Interface that represents a broadcast action.\danog\MadelineProto\Broadcast\Filter: Broadcast filter.
broadcastForwardMessages(mixed $from_peer, list<int> $message_ids, bool $drop_author = false, ?\danog\MadelineProto\Broadcast\Filter $filter = NULL, bool $pin = false, (float|null) $delay = NULL): int
Forwards a list of messages to all peers (users, chats, channels) of the bot.
Will return an integer ID that can be used to:
- Get the current broadcast progress with getBroadcastProgress
- Cancel the broadcast using cancelBroadcast
Note that to avoid manually polling the progress,
MadelineProto will also periodically emit updateBroadcastProgress updates,
containing a Progress object for all broadcasts currently in-progress.
Parameters:
$from_peer:mixedBot API ID or Update, from where to forward the messages.$message_ids:list<int>IDs of the messages to forward.$drop_author:boolIf true, will forward messages without quoting the original author.$filter:?\danog\MadelineProto\Broadcast\Filter$pin:boolWhether to also pin the last sent message.$delay:(float|null)Number of seconds to wait between each peer.
See also:
broadcastMessages(array $messages, ?\danog\MadelineProto\Broadcast\Filter $filter = NULL, bool $pin = false, (float|null) $delay = NULL): int
Sends a list of messages to all peers (users, chats, channels) of the bot.
A simplified version of this method is also available: broadcastForwardMessages can work with pre-prepared messages.
Will return an integer ID that can be used to:
- Get the current broadcast progress with getBroadcastProgress
- Cancel the broadcast using cancelBroadcast
Note that to avoid manually polling the progress,
MadelineProto will also periodically emit updateBroadcastProgress updates,
containing a Progress object for all broadcasts currently in-progress.
Parameters:
$messages:arrayThe messages to send: an array of arrays, containing parameters to pass to messages.sendMessage.$filter:?\danog\MadelineProto\Broadcast\Filter$pin:boolWhether to also pin the last sent message.$delay:(float|null)Number of seconds to wait between each peer.
See also:
callFork(\Generator|\Amp\Future|callable $callable, mixed ...$args): \Amp\Future<T>
Fork a new green thread and execute the passed function in the background.
Parameters:
$callable:\Generator|\Amp\Future|callable...$args:mixedArguments forwarded to the function when forking the thread.
See also:
\Generator\Amp\Future
callGetCurrent(int $id): \danog\MadelineProto\RemoteUrl|\danog\MadelineProto\LocalFile|string|null
Get the file that is currently being played.
Will return a string with the object ID of the stream if we’re currently playing a stream, otherwise returns the related LocalFile or RemoteUrl.
Parameters:
$id:int
See also:
\danog\MadelineProto\RemoteUrl: Indicates a remote URL to upload.\danog\MadelineProto\LocalFile: Indicates a local file to upload.
callPlay(int $id, \danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream $file): void
Play file in call.
Parameters:
$id:int$file:\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream
See also:
\danog\MadelineProto\LocalFile: Indicates a local file to upload.\danog\MadelineProto\RemoteUrl: Indicates a remote URL to upload.\Amp\ByteStream\ReadableStream
callPlayOnHold(int $id, \danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream ...$files): void
Play files on hold in call.
Parameters:
$id:int...$files:\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream
See also:
\danog\MadelineProto\LocalFile: Indicates a local file to upload.\danog\MadelineProto\RemoteUrl: Indicates a remote URL to upload.\Amp\ByteStream\ReadableStream
callSetOutput(int $id, \danog\MadelineProto\LocalFile|\Amp\ByteStream\WritableStream $file): void
Set output file or stream for incoming OPUS audio packets in a call.
Will write an OGG OPUS stream to the specified file or stream.
Parameters:
$id:int$file:\danog\MadelineProto\LocalFile|\Amp\ByteStream\WritableStream
See also:
\danog\MadelineProto\LocalFile: Indicates a local file to upload.\Amp\ByteStream\WritableStream
canConvertOgg(): bool
Whether we can convert any audio/video file to a VoIP OGG OPUS file, or the files must be preconverted using @libtgvoipbot.
canUseFFmpeg(?\Amp\Cancellation $cancellation = NULL): bool
Whether we can convert any audio/video file using ffmpeg.
Parameters:
$cancellation:?\Amp\Cancellation
See also:
\Amp\Cancellation
cancelBroadcast(integer $id): void
Cancel a running broadcast.
Parameters:
$id:integerBroadcast ID
closeConnection(string $message): void
Close connection with client, connected via web.
Parameters:
$message:stringMessage
complete2faLogin(string $password): array
Complete 2FA login.
Parameters:
$password:stringPassword
completePhoneLogin(string $code): array
Complet user login using login code.
Parameters:
$code:stringLogin code
completeSignup(string $first_name, string $last_name = ''): array
Complete signup to Telegram.
Parameters:
$first_name:stringFirst name$last_name:stringLast name
discardCall(int $id, \danog\MadelineProto\VoIP\DiscardReason $reason = \danog\MadelineProto\VoIP\DiscardReason::HANGUP, int<1, 5> $rating = NULL, string $comment = NULL): void
Discard call.
Parameters:
$id:int$reason:\danog\MadelineProto\VoIP\DiscardReason$rating:int<1, 5>Call rating in stars$comment:stringAdditional comment on call quality.
See also:
discardSecretChat(int $chat, bool $deleteHistory = false): void
Discard secret chat.
Parameters:
$chat:intSecret chat ID$deleteHistory:boolIf true, deletes the entire chat history for the other user as well.
downloadServer(string $session): void
Downloads a file to the browser using the specified session file.
Parameters:
$session:string
downloadToBrowser((array|string|\danog\MadelineProto\FileCallbackInterface|\danog\MadelineProto\EventHandler\Message) $messageMedia, (null|callable) $cb = NULL, (null|int) $size = NULL, (null|string) $name = NULL, (null|string) $mime = NULL, ?\Amp\Cancellation $cancellation = NULL): void
Download file to browser.
Supports HEAD requests and content-ranges for parallel and resumed downloads.
Parameters:
$messageMedia:(array|string|\danog\MadelineProto\FileCallbackInterface|\danog\MadelineProto\EventHandler\Message)File to download$cb:(null|callable)Status callback (can also use FileCallback)$size:(null|int)Size of file to download, required for bot API file IDs.$name:(null|string)Name of file to download, required for bot API file IDs.$mime:(null|string)MIME type of file to download, required for bot API file IDs.$cancellation:?\Amp\Cancellation
See also:
\danog\MadelineProto\FileCallbackInterface: File callback interface.\danog\MadelineProto\EventHandler\Message: Represents an incoming or outgoing message.\Amp\Cancellation
downloadToCallable(mixed $messageMedia, (callable|\danog\MadelineProto\FileCallbackInterface) $callable, callable $cb = NULL, bool $seekable = true, int $offset = 0, int $end = -1, int $part_size = NULL, ?\Amp\Cancellation $cancellation = NULL): void
Download file to callable. The callable must accept two parameters: string $payload, int $offset
The callable will be called (possibly out of order, depending on the value of $seekable).
Parameters:
$messageMedia:mixedFile to download$callable:(callable|\danog\MadelineProto\FileCallbackInterface)Chunk callback$cb:callableStatus callback$seekable:boolWhether the callable can be called out of order$offset:intOffset where to start downloading$end:intOffset where to stop downloading (inclusive)$part_size:intSize of each chunk$cancellation:?\Amp\Cancellation
See also:
\danog\MadelineProto\FileCallbackInterface: File callback interface.\Amp\Cancellation
downloadToDir(mixed $messageMedia, (string|\danog\MadelineProto\FileCallbackInterface) $dir, callable $cb = NULL, ?\Amp\Cancellation $cancellation = NULL): non-empty-string
Download file to directory.
Parameters:
$messageMedia:mixedFile to download$dir:(string|\danog\MadelineProto\FileCallbackInterface)Directory where to download the file$cb:callableCallback$cancellation:?\Amp\Cancellation
Return value: Downloaded file name
See also:
\danog\MadelineProto\FileCallbackInterface: File callback interface.\Amp\Cancellationnon-empty-string
downloadToFile(mixed $messageMedia, (string|\danog\MadelineProto\FileCallbackInterface) $file, callable $cb = NULL, ?\Amp\Cancellation $cancellation = NULL): non-empty-string
Download file.
Parameters:
$messageMedia:mixedFile to download$file:(string|\danog\MadelineProto\FileCallbackInterface)Downloaded file path$cb:callableCallback$cancellation:?\Amp\Cancellation
Return value: Downloaded file name
See also:
\danog\MadelineProto\FileCallbackInterface: File callback interface.\Amp\Cancellationnon-empty-string
downloadToResponse((array|string|\danog\MadelineProto\FileCallbackInterface|\danog\MadelineProto\EventHandler\Message) $messageMedia, \Amp\Http\Server\Request $request, callable $cb = NULL, (null|int) $size = NULL, (null|string) $mime = NULL, (null|string) $name = NULL, ?\Amp\Cancellation $cancellation = NULL): \Amp\Http\Server\Response
Download file to amphp/http-server response.
Supports HEAD requests and content-ranges for parallel and resumed downloads.
Parameters:
$messageMedia:(array|string|\danog\MadelineProto\FileCallbackInterface|\danog\MadelineProto\EventHandler\Message)File to download$request:\Amp\Http\Server\RequestRequest$cb:callableStatus callback (can also use FileCallback)$size:(null|int)Size of file to download, required for bot API file IDs.$mime:(null|string)MIME type of file to download, required for bot API file IDs.$name:(null|string)Name of file to download, required for bot API file IDs.$cancellation:?\Amp\Cancellation
See also:
\danog\MadelineProto\FileCallbackInterface: File callback interface.\danog\MadelineProto\EventHandler\Message: Represents an incoming or outgoing message.\Amp\Http\Server\Request\Amp\Cancellation\Amp\Http\Server\Response
downloadToReturnedStream(mixed $messageMedia, callable $cb = NULL, int $offset = 0, int $end = -1, ?\Amp\Cancellation $cancellation = NULL): \Amp\ByteStream\ReadableStream
Download file to an amphp stream, returning it.
Parameters:
$messageMedia:mixedFile to download$cb:callableCallback$offset:intOffset where to start downloading$end:intOffset where to end download$cancellation:?\Amp\Cancellation
See also:
\Amp\Cancellation\Amp\ByteStream\ReadableStream
downloadToStream(mixed $messageMedia, (mixed|\danog\MadelineProto\FileCallbackInterface|resource|\Amp\ByteStream\WritableStream) $stream, callable $cb = NULL, int $offset = 0, int $end = -1, ?\Amp\Cancellation $cancellation = NULL): void
Download file to stream.
Parameters:
$messageMedia:mixedFile to download$stream:(mixed|\danog\MadelineProto\FileCallbackInterface|resource|\Amp\ByteStream\WritableStream)Stream where to download file$cb:callableCallback$offset:intOffset where to start downloading$end:intOffset where to end download$cancellation:?\Amp\Cancellation
See also:
\danog\MadelineProto\FileCallbackInterface: File callback interface.resource\Amp\ByteStream\WritableStream\Amp\Cancellation
echo(string $string): void
Asynchronously write to stdout/browser.
Parameters:
$string:stringMessage to echo
end(array<T> $what): T
Get final element of array.
Parameters:
$what:array<T>Array
entitiesToHtml(string $message, list<(\danog\MadelineProto\EventHandler\Message\Entities\MessageEntity|array{_: string, offset: int, length: int})> $entities, bool $allowTelegramTags = false): string
Convert a message and a set of entities to HTML.
Parameters:
$message:string$entities:list<(\danog\MadelineProto\EventHandler\Message\Entities\MessageEntity|array{_: string, offset: int, length: int})>$allowTelegramTags:boolWhether to allow telegram-specific tags like tg-spoiler, tg-emoji, mention links and so on…
See also:
\danog\MadelineProto\EventHandler\Message\Entities\MessageEntity: Master class for message entities.
exportAuthorization(): array{0: int, 1: string}
Export authorization.
extractBotAPIFile(array $info): ?array
Extract file info from bot API message.
Parameters:
$info:arrayBot API message object
extractMessage(array $updates): array
Extract a message constructor from an Updates constructor.
Parameters:
$updates:array
extractMessageId(array $updates): int
Extract a message ID from an Updates constructor.
Parameters:
$updates:array
extractMessageUpdate(array $updates): array
Extract an update message constructor from an Updates constructor.
Parameters:
$updates:array
extractUpdates(array $updates): array<array>
Extract Update constructors from an Updates constructor.
Parameters:
$updates:array
fileGetContents(string $url, ?\Amp\Cancellation $cancellation = NULL): string
Get contents of remote file asynchronously.
Parameters:
$url:stringURL$cancellation:?\Amp\Cancellation
See also:
\Amp\Cancellation
flock(string $file, integer $operation, float $polling = 0.1, ?\Amp\Cancellation $token = NULL, ?\Closure $failureCb = NULL): ($token is null ? Closure(): void : (Closure(): void | null))
Asynchronously lock a file Resolves with a callbable that MUST eventually be called in order to release the lock.
Parameters:
$file:stringFile to lock$operation:integerLocking mode$polling:floatPolling interval$token:?\Amp\CancellationCancellation token$failureCb:?\ClosureFailure callback, called only once if the first locking attempt fails.
See also:
\Amp\Cancellation\Closure
fullChatLastUpdated(mixed $id): int
When was full info for this chat last cached.
Parameters:
$id:mixedChat ID
fullGetSelf(): array|false
Get info about the logged-in user, not cached.
genVectorHash(array<(string|int)> $longs): string
Generate MTProto vector hash.
Returns a vector hash.
Parameters:
$longs:array<(string|int)>IDs
getAdminIds(): array
Get admin IDs (equal to all user report peers).
getAllCalls(): array<int, \danog\MadelineProto\VoIP>
Get all pending and running calls, indexed by user ID.
See also:
getAllMethods(): array
Get full list of MTProto and API methods.
getAuthorization(): (\danog\MadelineProto\API::NOT_LOGGED_IN|\danog\MadelineProto\API::WAITING_CODE|\danog\MadelineProto\API::WAITING_SIGNUP|\danog\MadelineProto\API::WAITING_PASSWORD|\danog\MadelineProto\API::LOGGED_IN|API::LOGGED_OUT)
Get authorization info.
See also:
\danog\MadelineProto\API::NOT_LOGGED_IN\danog\MadelineProto\API::WAITING_CODE\danog\MadelineProto\API::WAITING_SIGNUP\danog\MadelineProto\API::WAITING_PASSWORD\danog\MadelineProto\API::LOGGED_INAPI::LOGGED_OUT
getBroadcastProgress(integer $id): ?\danog\MadelineProto\Broadcast\Progress
Get the progress of a currently running broadcast.
Will return null if the broadcast doesn’t exist, has already completed or was cancelled.
Use updateBroadcastProgress updates to get real-time progress status without polling.
Parameters:
$id:integerBroadcast ID
See also:
getCachedConfig(): array
Get cached server-side config.
getCall(int $id): ?\danog\MadelineProto\VoIP
Get phone call information.
Parameters:
$id:int
See also:
getCallByPeer(int $userId): ?\danog\MadelineProto\VoIP
Get the phone call with the specified user ID.
Parameters:
$userId:int
See also:
getCallState(int $id): ?\danog\MadelineProto\VoIP\CallState
Get call state.
Parameters:
$id:int
See also:
getCdnConfig(): void
Store RSA keys for CDN datacenters.
getConfig(array $config = []): array
Get cached (or eventually re-fetch) server-side config.
Parameters:
$config:arrayCurrent config
getDNSClient(): \Amp\Dns\DnsResolver
Get async DNS client.
See also:
\Amp\Dns\DnsResolver
getDhConfig(?\Amp\Cancellation $cancellation = NULL): array
Get diffie-hellman configuration.
Parameters:
$cancellation:?\Amp\Cancellation
See also:
\Amp\Cancellation
getDialogIds(): list<int>
Get dialog IDs.
getDownloadInfo(mixed $messageMedia): array{ext: string, name: string, mime: string, size: int, InputFileLocation: array, key_fingerprint?: string, key?: string, iv?: string, thumb_size?: string}
Get download info of file Returns an array with the following structure:.
$info['ext'] - The file extension
$info['name'] - The file name, without the extension
$info['mime'] - The file mime type
$info['size'] - The file size
Parameters:
$messageMedia:mixedFile ID
getDownloadLink(\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|array|string $media, ?string $scriptUrl = NULL, ?int $size = NULL, ?string $name = NULL, ?string $mime = NULL): string
Get download link of media file.
Parameters:
$media:\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|array|string$scriptUrl:?string$size:?int$name:?string$mime:?string
See also:
\danog\MadelineProto\EventHandler\Message: Represents an incoming or outgoing message.\danog\MadelineProto\EventHandler\Media: Represents a generic media.
getEventHandler((class-string<T>|null) $class = NULL): (T|\danog\MadelineProto\Ipc\EventHandlerProxy|\__PHP_Incomplete_Class|null)
Get event handler (or plugin instance).
Parameters:
$class:(class-string<T>|null)
See also:
\danog\MadelineProto\Ipc\EventHandlerProxy\__PHP_Incomplete_Class
getExtensionFromLocation(mixed $location, string $default): string
Get extension from file location.
Parameters:
$location:mixedFile location$default:stringDefault extension
getExtensionFromMime(string $mime): string
Get extension from mime type.
Parameters:
$mime:stringMIME type
getFileInfo(mixed $constructor): array
Get info about file.
Parameters:
$constructor:mixedFile ID
getFullDialogs(): array<int, array>
Get full info of all dialogs.
Bots should use getDialogIds, instead.
getFullInfo(mixed $id): array
Get full info about peer, returns an FullInfo object.
Parameters:
$id:mixedPeer
See also:
getHTTPClient(): \Amp\Http\Client\HttpClient
Get async HTTP client.
See also:
\Amp\Http\Client\HttpClient
getHint(): string
Get current password hint.
getId(mixed $id): int
Get the bot API ID of a peer.
Parameters:
$id:mixedPeer
getInfo(mixed $id, \danog\MadelineProto\API::INFO_TYPE_* $type = \danog\MadelineProto\API::INFO_TYPE_ALL): (\$type is \danog\MadelineProto\API::INFO_TYPE_ALL ? array{User?: array, Chat?: array, bot_api_id: int, user_id?: int, chat_id?: int, channel_id?: int, type: string} : ($type is API::INFO_TYPE_TYPE ? string : ($type is \danog\MadelineProto\API::INFO_TYPE_ID ? int : (array{_: string, user_id?: int, access_hash?: int, min?: bool, chat_id?: int, channel_id?: int} | array{_: string, user_id?: int, access_hash?: int, min?: bool} | array{_: string, channel_id: int, access_hash: int, min: bool}))))
Get info about peer, returns an Info object.
If passed a secret chat ID, returns information about the user, not about the secret chat.
Use getSecretChat to return information about the secret chat.
Parameters:
$id:mixedPeer$type:\danog\MadelineProto\API::INFO_TYPE_*Whether to generate an Input*, an InputPeer or the full set of constructors
See also:
- https://docs.madelineproto.xyz/Info.html
\danog\MadelineProto\API::INFO_TYPE_*
getLogger(): \danog\MadelineProto\Logger
Get logger.
See also:
getMaps(): ?int
Get current number of memory-mapped regions, UNIX only.
getMaxMaps(): ?int
Get maximum number of memory-mapped regions, UNIX only. Use testFibers to get the maximum number of fibers on any platform.
getMemoryProfile(): string
Get memory profile with memprof.
getMethodNamespaces(): array
Get TL namespaces.
getMethodsNamespaced(): array
Get namespaced methods (method => namespace).
getMimeFromBuffer(string $buffer): string
Get mime type from buffer.
Parameters:
$buffer:stringBuffer
getMimeFromExtension(string $extension, string $default): string
Get mime type from file extension.
Parameters:
$extension:stringFile extension$default:stringDefault mime type
getMimeFromFile(string $file): string
Get mime type of file.
Parameters:
$file:stringFile
getPlugin(class-string<T> $class): \danog\MadelineProto\PluginEventHandler|\danog\MadelineProto\Ipc\EventHandlerProxy|null
Obtain a certain event handler plugin instance.
Parameters:
$class:class-string<T>
return T|null
See also:
\danog\MadelineProto\PluginEventHandler: Plugin event handler class.\danog\MadelineProto\Ipc\EventHandlerProxy
getPromCounter(string $namespace, string $name, string $help, array<string, string> $labels = []): ?\danog\BetterPrometheus\BetterCounter
Creates and returns a prometheus counter.
Returns null if prometheus stats are disabled.
Parameters:
$namespace:string$name:string$help:string$labels:array<string, string>
See also:
\danog\BetterPrometheus\BetterCounter
getPromGauge(string $namespace, string $name, string $help, array<string, string> $labels = []): ?\danog\BetterPrometheus\BetterGauge
Creates and returns a prometheus gauge.
Returns null if prometheus stats are disabled.
Parameters:
$namespace:string$name:string$help:string$labels:array<string, string>
See also:
\danog\BetterPrometheus\BetterGauge
getPromHistogram(string $namespace, string $name, string $help, array<string, string> $labels = [], ?non-empty-list<float> $buckets = NULL): ?\danog\BetterPrometheus\BetterHistogram
Creates and returns a prometheus histogram.
Returns null if prometheus stats are disabled.
Parameters:
$namespace:string$name:string$help:string$labels:array<string, string>$buckets:?non-empty-list<float>
See also:
non-empty-list\danog\BetterPrometheus\BetterHistogram
getPromSummary(string $namespace, string $name, string $help, array<string, string> $labels = [], int $maxAgeSeconds = 600, ?non-empty-list<float> $quantiles = NULL): ?\danog\BetterPrometheus\BetterSummary
Creates and returns a prometheus summary.
Returns null if prometheus stats are disabled.
Parameters:
$namespace:string$name:string$help:string$labels:array<string, string>$maxAgeSeconds:int$quantiles:?non-empty-list<float>
See also:
non-empty-list\danog\BetterPrometheus\BetterSummary
getPropicInfo(mixed $data): ?\danog\MadelineProto\EventHandler\Media\Photo
Gets info of the propic of a user.
Parameters:
$data:mixed
See also:
getPsrLogger(): \Psr\Log\LoggerInterface
Get PSR logger.
See also:
\Psr\Log\LoggerInterface
getPwrChat(mixed $id, bool $fullfetch = true): array
Get full info about peer (including full list of channel members), returns a Chat object.
Parameters:
$id:mixedPeer$fullfetch:bool
See also:
getSecretChat((array|int) $chat): \danog\MadelineProto\SecretChats\SecretChat
Get secret chat.
Parameters:
$chat:(array|int)Secret chat ID
See also:
getSecretMessage(integer $chatId, integer $randomId): \danog\MadelineProto\EventHandler\Message\SecretMessage
Gets a secret chat message.
Parameters:
$chatId:integerSecret chat ID.$randomId:integerSecret chat message ID.
See also:
getSelf(): array|false
Get info about the logged-in user, cached.
Use fullGetSelf to bypass the cache.
getSessionName(): string
Returns the session name.
getSettings(): \danog\MadelineProto\Settings
Return current settings.
See also:
getSponsoredMessages((int|string|array) $peer): ?array
Get sponsored messages for channel. This method will return an array of sponsored message objects.
See the API documentation for more info on how to handle sponsored messages.
Parameters:
$peer:(int|string|array)Channel ID, or Update, or Message, or Peer.
getStream(\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream $stream, ?\Amp\Cancellation $cancellation = NULL, ?int $size = NULL): \Amp\ByteStream\ReadableStream
Provide a stream for a file, URL or amp stream.
Parameters:
$stream:\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream$cancellation:?\Amp\Cancellation$size:?int
See also:
\danog\MadelineProto\EventHandler\Message: Represents an incoming or outgoing message.\danog\MadelineProto\EventHandler\Media: Represents a generic media.\danog\MadelineProto\LocalFile: Indicates a local file to upload.\danog\MadelineProto\RemoteUrl: Indicates a remote URL to upload.\danog\MadelineProto\BotApiFileId: Indicates a bot API file ID to upload using sendDocument, sendPhoto etc…\Amp\ByteStream\ReadableStream\Amp\Cancellation
getStreamPipe(): \Amp\ByteStream\Pipe
Obtains a pipe that can be used to upload a file from a stream.
See also:
\Amp\ByteStream\Pipe
getTL(): \danog\MadelineProto\TL\TLInterface
Get TL serializer.
See also:
getType(mixed $id): \danog\MadelineProto\API::PEER_TYPE_*
Get type of peer.
Parameters:
$id:mixedPeer
See also:
\danog\MadelineProto\API::PEER_TYPE_*
getUpdates(array{offset?: int, limit?: int, timeout?: float} $params = []): list<array{update_id: mixed, update: mixed}>
Only useful when consuming MadelineProto updates through an API in another language (like Javascript), absolutely not recommended when directly writing MadelineProto bots.
getUpdates will greatly slow down your bot if used directly inside of PHP code.
Only use the event handler when writing a MadelineProto bot, because update handling in the event handler is completely parallelized and non-blocking.
Parameters:
$params:array{offset?: int, limit?: int, timeout?: float}Params
getWebMessage(string $message): string
Get a message to show to the user when starting the bot.
Parameters:
$message:string
getWebWarnings(): string
Get various warnings to show to the user in the web UI.
hasAdmins(): bool
Check if has admins.
hasEventHandler(): bool
Check if an event handler instance is present.
hasPlugin(class-string<\danog\MadelineProto\EventHandler> $class): bool
Check if a certain event handler plugin is installed.
Parameters:
$class:class-string<\danog\MadelineProto\EventHandler>
See also:
hasReportPeers(): bool
Check if has report peers.
hasSecretChat((array|int) $chat): bool
Check whether secret chat exists.
Parameters:
$chat:(array|int)Secret chat ID
htmlEscape(string $what): string
Escape string for MadelineProto’s HTML entity converter.
Parameters:
$what:stringString to escape
htmlToMessageEntities(string $html): \danog\MadelineProto\TextEntities
Manually convert HTML to a message and a set of entities.
NOTE: You don’t have to use this method to send HTML messages.
This method is already called automatically by using parse_mode: “HTML” in messages.sendMessage, messages.sendMedia, et cetera…
Parameters:
$html:string
Return value: Object containing message and entities
See also:
- https://docs.madelineproto.xyz/API_docs/methods/messages.sendMessage.html#usage-of-parse_mode
\danog\MadelineProto\TextEntities: Class that converts HTML or markdown to a message + set of entities.
importAuthorization(array<int, string> $authorization, int $mainDcID): array
Import authorization.
Parameters:
$authorization:array<int, string>Authorization info$mainDcID:intMain DC ID
inflateStripped(string $stripped): string
Inflate stripped photosize to full JPG payload.
Parameters:
$stripped:stringStripped photosize
initSelfRestart(): void
Initialize self-restart hack.
isAltervista(): bool
Whether this is altervista.
isArrayOrAlike(mixed $var): bool
Check if is array or similar (traversable && countable && arrayAccess).
Parameters:
$var:mixedValue to check
isBot(mixed $peer): bool
Check if the specified peer is a bot.
Parameters:
$peer:mixed
isForum(mixed $peer): bool
Check if the specified peer is a forum.
Parameters:
$peer:mixed
isIpc(): bool
Whether we’re an IPC client instance.
isIpcWorker(): bool
Whether we’re an IPC server process (as opposed to an event handler).
isPlayPaused(int $id): bool
Whether the currently playing audio file is paused.
Parameters:
$id:int
isPremium(): bool
Returns whether the current user is a premium user, cached.
isSelfBot(): bool
Returns whether the current user is a bot.
isSelfUser(): bool
Returns whether the current user is a user.
isTestMode(): boolean
Whether we’re currently connected to the test DCs.
logger(mixed $param, int $level = \danog\MadelineProto\Logger::NOTICE, string $file = ''): void
Logger.
Parameters:
$param:mixedParameter$level:intLogging level$file:stringFile where the message originated
logout(): void
Logout the session.
markdownCodeEscape(string $what): string
Escape string for markdown code section.
Parameters:
$what:stringString to escape
markdownCodeblockEscape(string $what): string
Escape string for markdown codeblock.
Parameters:
$what:stringString to escape
markdownEscape(string $what): string
Escape string for markdown.
Parameters:
$what:stringString to escape
markdownToMessageEntities(string $markdown): \danog\MadelineProto\TextEntities
Manually convert markdown to a message and a set of entities.
NOTE: You don’t have to use this method to send Markdown messages.
This method is already called automatically by using parse_mode: “Markdown” in messages.sendMessage, messages.sendMedia, et cetera…
Parameters:
$markdown:string
Return value: Object containing message and entities
See also:
- https://docs.madelineproto.xyz/API_docs/methods/messages.sendMessage.html#usage-of-parse_mode
\danog\MadelineProto\TextEntities: Class that converts HTML or markdown to a message + set of entities.
markdownUrlEscape(string $what): string
Escape string for URL.
Parameters:
$what:stringString to escape
mbStrSplit(string $text, integer $length): array<string>
Telegram UTF-8 multibyte split.
Parameters:
$text:stringText$length:integerLength
mbStrlen(string $text): int
Get Telegram UTF-8 length of string.
Parameters:
$text:stringText
mbSubstr(string $text, integer $offset, (null|int) $length = NULL): string
Telegram UTF-8 multibyte substring.
Parameters:
$text:stringText to substring$offset:integerOffset$length:(null|int)Length
openBuffered(\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream $stream, ?\Amp\Cancellation $cancellation = NULL): Closure(int): ?string
Provide a buffered reader for a file, URL or amp stream.
Parameters:
$stream:\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream$cancellation:?\Amp\Cancellation
See also:
\danog\MadelineProto\LocalFile: Indicates a local file to upload.\danog\MadelineProto\RemoteUrl: Indicates a remote URL to upload.\Amp\ByteStream\ReadableStream\Amp\Cancellation
openFileAppendOnly(string $path): \Amp\File\File
Opens a file in append-only mode.
Parameters:
$path:stringFile path.
See also:
\Amp\File\File
packDouble(float $value): string
Convert double to binary version.
Parameters:
$value:floatValue to convert
packSignedInt(integer $value): string
Convert integer to base256 signed int.
Parameters:
$value:integerValue to convert
packSignedLong(int $value): string
Convert integer to base256 long.
Parameters:
$value:intValue to convert
packUnsignedInt(int $value): string
Convert value to unsigned base256 int.
Parameters:
$value:intValue
pausePlay(int $id): void
Pauses playback of the current audio file in the call.
Parameters:
$id:int
peerIsset(mixed $id): bool
Check if peer is present in internal peer database.
Parameters:
$id:mixedPeer
phoneLogin(string $number, integer $sms_type = 5): array
Login as user.
Parameters:
$number:stringPhone number$sms_type:integerSMS type
posmod(int $a, int $b): int
Positive modulo Works just like the % (modulus) operator, only returns always a postive number.
Parameters:
$a:intA$b:intB
processDownloadServerPing(string $path, string $payload): void
Internal endpoint used by the download server.
Parameters:
$path:string$payload:string
qrLogin(): ?\danog\MadelineProto\TL\Types\LoginQrCode
Initiates QR code login.
Returns a QR code login helper object, that can be used to render the QR code, display the link directly, wait for login, QR code expiration and much more.
Returns null if we’re already logged in, or if we’re waiting for a password (use getAuthorization to distinguish between the two cases).
See also:
random(integer $length): string
Get secure random string of specified length.
Parameters:
$length:integerLength
randomInt(integer $modulus = 0): int
Get random integer.
Parameters:
$modulus:integerModulus
readLine(string $prompt = '', ?\Amp\Cancellation $cancel = NULL): string
Asynchronously read line.
Parameters:
$prompt:stringPrompt$cancel:?\Amp\Cancellation
See also:
\Amp\Cancellation
refreshFullPeerCache(mixed $id): void
Refresh full peer cache for a certain peer.
Parameters:
$id:mixedThe peer to refresh
refreshPeerCache(mixed ...$ids): void
Refresh peer cache for a certain peer.
Parameters:
...$ids:mixed
renderPromStats(?\Prometheus\RendererInterface $renderer = NULL): string
Renders prometheus stats using the specified renderer.
By default uses the text renderer.
Parameters:
$renderer:?\Prometheus\RendererInterface
See also:
\Prometheus\RendererInterface
report(string $message, string $parseMode = ''): void
Report an error to the previously set peer.
Parameters:
$message:stringError to report$parseMode:stringParse mode
reportMemoryProfile(): void
Report memory profile with memprof.
requestCall(mixed $user): \danog\MadelineProto\VoIP
Request VoIP call.
Parameters:
$user:mixedUser
See also:
requestSecretChat(mixed $user): int
Request secret chat.
Parameters:
$user:mixedUser to start secret chat with
resetUpdateState(): void
Reset the update state and fetch all updates from the beginning.
restart(): void
Restart update loop.
resumePlay(int $id): void
Resumes playback of the current audio file in the call.
Parameters:
$id:int
rethrow(Throwable $e): void
Rethrow exception into event loop.
Parameters:
$e:Throwable
See also:
Throwable
rleDecode(string $string): string
null-byte RLE decode.
Parameters:
$string:stringData to decode
rleEncode(string $string): string
null-byte RLE encode.
Parameters:
$string:stringData to encode
sendAudio((integer|string) $peer, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream) $file, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream|null) $thumb = NULL, string $caption = '', \danog\MadelineProto\ParseMode $parseMode = \danog\MadelineProto\ParseMode::TEXT, ?callable $callback = NULL, ?string $fileName = NULL, ?string $mimeType = NULL, (integer|null) $duration = NULL, (string|null) $title = NULL, (string|null) $performer = NULL, ?int $ttl = NULL, (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|string|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, boolean $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $forceResend = false, ?\Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\Message
Sends an audio.
Please use named arguments to call this method.
Parameters:
$peer:(integer|string)Destination peer or username.$file:(\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream)File to upload: can be a message to reuse media present in a message.$thumb:(\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream|null)Optional: Thumbnail to upload$caption:stringCaption of document$parseMode:\danog\MadelineProto\ParseModeText parse mode for the caption$callback:?callable$fileName:?stringOptional file name, if absent will be extracted from the passed $file.$mimeType:?string$duration:(integer|null)Duration of the audio$title:(string|null)Title of the audio$performer:(string|null)Performer of the audio$ttl:?int$replyToMsgId:(integer|null)ID of message to reply to.$topMsgId:(integer|null)ID of thread where to send the message.$replyMarkup:(array|null)Keyboard information.$sendAs:(integer|string|null)Peer to send the message as.$scheduleDate:(integer|null)Schedule date.$silent:booleanWhether to send the message silently, without triggering notifications.$noForwards:booleanWhether to disable forwards for this message.$background:booleanSend this message as background message$clearDraft:booleanClears the draft field$forceResend:booleanWhether to forcefully resend the file, even if its type and name are the same.$cancellation:?\Amp\CancellationCancellation.
See also:
\danog\MadelineProto\EventHandler\Message: Represents an incoming or outgoing message.\danog\MadelineProto\EventHandler\Media: Represents a generic media.\danog\MadelineProto\LocalFile: Indicates a local file to upload.\danog\MadelineProto\RemoteUrl: Indicates a remote URL to upload.\danog\MadelineProto\BotApiFileId: Indicates a bot API file ID to upload using sendDocument, sendPhoto etc…\Amp\ByteStream\ReadableStream\danog\MadelineProto\ParseMode: Indicates a parsing mode for text.\Amp\Cancellation
sendCustomEvent(mixed $payload): void
Sends an updateCustomEvent update to the event handler.
Parameters:
$payload:mixed
sendDocument((integer|string) $peer, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream) $file, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream|null) $thumb = NULL, string $caption = '', \danog\MadelineProto\ParseMode $parseMode = \danog\MadelineProto\ParseMode::TEXT, ?callable $callback = NULL, ?string $fileName = NULL, ?string $mimeType = NULL, ?int $ttl = NULL, bool $spoiler = false, (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, bool $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $updateStickersetsOrder = false, boolean $forceResend = false, \Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\Message
Sends a document.
Please use named arguments to call this method.
Parameters:
$peer:(integer|string)Destination peer or username.$file:(\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream)File to upload: can be a message to reuse media present in a message.$thumb:(\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream|null)Optional: Thumbnail to upload$caption:stringCaption of document$parseMode:\danog\MadelineProto\ParseModeText parse mode for the caption$callback:?callable$fileName:?stringOptional file name, if absent will be extracted from the passed $file.$mimeType:?string$ttl:?int$spoiler:bool$replyToMsgId:(integer|null)ID of message to reply to.$topMsgId:(integer|null)ID of thread where to send the message.$replyMarkup:(array|null)Keyboard information.$sendAs:(integer|null)Peer to send the message as.$scheduleDate:(integer|null)Schedule date.$silent:booleanWhether to send the message silently, without triggering notifications.$noForwards:bool$background:booleanSend this message as background message$clearDraft:booleanClears the draft field$updateStickersetsOrder:booleanWhether to move used stickersets to top$forceResend:booleanWhether to forcefully resend the file, even if its type and name are the same.$cancellation:\Amp\CancellationCancellation.
See also:
\danog\MadelineProto\EventHandler\Message: Represents an incoming or outgoing message.\danog\MadelineProto\EventHandler\Media: Represents a generic media.\danog\MadelineProto\LocalFile: Indicates a local file to upload.\danog\MadelineProto\RemoteUrl: Indicates a remote URL to upload.\danog\MadelineProto\BotApiFileId: Indicates a bot API file ID to upload using sendDocument, sendPhoto etc…\Amp\ByteStream\ReadableStream\danog\MadelineProto\ParseMode: Indicates a parsing mode for text.\Amp\Cancellation
sendDocumentPhoto((integer|string) $peer, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream) $file, string $caption = '', \danog\MadelineProto\ParseMode $parseMode = \danog\MadelineProto\ParseMode::TEXT, ?callable $callback = NULL, ?string $fileName = NULL, ?int $ttl = NULL, bool $spoiler = false, (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, bool $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $updateStickersetsOrder = false, boolean $forceResend = false, \Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\Message
Sends a photo.
Please use named arguments to call this method.
Parameters:
$peer:(integer|string)Destination peer or username.$file:(\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream)File to upload: can be a message to reuse media present in a message.$caption:stringCaption of document$parseMode:\danog\MadelineProto\ParseModeText parse mode for the caption$callback:?callable$fileName:?stringOptional file name, if absent will be extracted from the passed $file.$ttl:?int$spoiler:bool$replyToMsgId:(integer|null)ID of message to reply to.$topMsgId:(integer|null)ID of thread where to send the message.$replyMarkup:(array|null)Keyboard information.$sendAs:(integer|null)Peer to send the message as.$scheduleDate:(integer|null)Schedule date.$silent:booleanWhether to send the message silently, without triggering notifications.$noForwards:bool$background:booleanSend this message as background message$clearDraft:booleanClears the draft field$updateStickersetsOrder:booleanWhether to move used stickersets to top$forceResend:booleanWhether to forcefully resend the file, even if its type and name are the same.$cancellation:\Amp\CancellationCancellation.
See also:
\danog\MadelineProto\EventHandler\Message: Represents an incoming or outgoing message.\danog\MadelineProto\EventHandler\Media: Represents a generic media.\danog\MadelineProto\LocalFile: Indicates a local file to upload.\danog\MadelineProto\RemoteUrl: Indicates a remote URL to upload.\danog\MadelineProto\BotApiFileId: Indicates a bot API file ID to upload using sendDocument, sendPhoto etc…\Amp\ByteStream\ReadableStream\danog\MadelineProto\ParseMode: Indicates a parsing mode for text.\Amp\Cancellation
sendGif((integer|string) $peer, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream) $file, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream|null) $thumb = NULL, string $caption = '', \danog\MadelineProto\ParseMode $parseMode = \danog\MadelineProto\ParseMode::TEXT, ?callable $callback = NULL, ?string $fileName = NULL, (integer|null) $ttl = NULL, boolean $spoiler = false, ?int $duration = NULL, ?int $width = NULL, ?int $height = NULL, string $thumbSeek = '00:00:01.000', (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|string|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, boolean $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $forceResend = false, ?\Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\Message
Sends a gif.
Please use named arguments to call this method.
Parameters:
$peer:(integer|string)Destination peer or username.$file:(\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream)File to upload: can be a message to reuse media present in a message.$thumb:(\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream|null)Optional: Thumbnail to upload$caption:stringCaption of document$parseMode:\danog\MadelineProto\ParseModeText parse mode for the caption$callback:?callable$fileName:?stringOptional file name, if absent will be extracted from the passed $file.$ttl:(integer|null)Time to live$spoiler:booleanWhether the message is a spoiler$duration:?int$width:?int$height:?int$thumbSeek:string$replyToMsgId:(integer|null)ID of message to reply to.$topMsgId:(integer|null)ID of thread where to send the message.$replyMarkup:(array|null)Keyboard information.$sendAs:(integer|string|null)Peer to send the message as.$scheduleDate:(integer|null)Schedule date.$silent:booleanWhether to send the message silently, without triggering notifications.$noForwards:booleanWhether to disable forwards for this message.$background:booleanSend this message as background message$clearDraft:booleanClears the draft field$forceResend:booleanWhether to forcefully resend the file, even if its type and name are the same.$cancellation:?\Amp\CancellationCancellation.
See also:
\danog\MadelineProto\EventHandler\Message: Represents an incoming or outgoing message.\danog\MadelineProto\EventHandler\Media: Represents a generic media.\danog\MadelineProto\LocalFile: Indicates a local file to upload.\danog\MadelineProto\RemoteUrl: Indicates a remote URL to upload.\danog\MadelineProto\BotApiFileId: Indicates a bot API file ID to upload using sendDocument, sendPhoto etc…\Amp\ByteStream\ReadableStream\danog\MadelineProto\ParseMode: Indicates a parsing mode for text.\Amp\Cancellation
sendMessage((integer|string) $peer, string $message, \danog\MadelineProto\ParseMode $parseMode = \danog\MadelineProto\ParseMode::TEXT, (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, bool $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $noWebpage = false, boolean $updateStickersetsOrder = false, ?\Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\Message
Sends a message.
Parameters:
$peer:(integer|string)Destination peer or username.$message:stringMessage to send$parseMode:\danog\MadelineProto\ParseModeParse mode$replyToMsgId:(integer|null)ID of message to reply to.$topMsgId:(integer|null)ID of thread where to send the message.$replyMarkup:(array|null)Keyboard information.$sendAs:(integer|null)Peer to send the message as.$scheduleDate:(integer|null)Schedule date.$silent:booleanWhether to send the message silently, without triggering notifications.$noForwards:bool$background:booleanSend this message as background message$clearDraft:booleanClears the draft field$noWebpage:booleanSet this flag to disable generation of the webpage preview$updateStickersetsOrder:booleanWhether to move used stickersets to top$cancellation:?\Amp\CancellationCancellation
See also:
\danog\MadelineProto\ParseMode: Indicates a parsing mode for text.\Amp\Cancellation\danog\MadelineProto\EventHandler\Message: Represents an incoming or outgoing message.
sendMessageToAdmins(string $message, \danog\MadelineProto\ParseMode $parseMode = \danog\MadelineProto\ParseMode::TEXT, (array|null) $replyMarkup = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, bool $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $noWebpage = false, ?\Amp\Cancellation $cancellation = NULL): list<\danog\MadelineProto\EventHandler\Message>
Sends a message to all report peers (admins of the bot).
Parameters:
$message:stringMessage to send$parseMode:\danog\MadelineProto\ParseModeParse mode$replyMarkup:(array|null)Keyboard information.$scheduleDate:(integer|null)Schedule date.$silent:booleanWhether to send the message silently, without triggering notifications.$noForwards:bool$background:booleanSend this message as background message$clearDraft:booleanClears the draft field$noWebpage:booleanSet this flag to disable generation of the webpage preview$cancellation:?\Amp\Cancellation
See also:
\danog\MadelineProto\ParseMode: Indicates a parsing mode for text.\Amp\Cancellation\danog\MadelineProto\EventHandler\Message: Represents an incoming or outgoing message.
sendPhoto((integer|string) $peer, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream) $file, string $caption = '', \danog\MadelineProto\ParseMode $parseMode = \danog\MadelineProto\ParseMode::TEXT, ?callable $callback = NULL, ?string $fileName = NULL, ?int $ttl = NULL, bool $spoiler = false, (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, bool $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $updateStickersetsOrder = false, boolean $forceResend = false, \Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\Message
Sends a photo.
Please use named arguments to call this method.
Parameters:
$peer:(integer|string)Destination peer or username.$file:(\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream)File to upload: can be a message to reuse media present in a message.$caption:stringCaption of document$parseMode:\danog\MadelineProto\ParseModeText parse mode for the caption$callback:?callable$fileName:?stringOptional file name, if absent will be extracted from the passed $file.$ttl:?int$spoiler:bool$replyToMsgId:(integer|null)ID of message to reply to.$topMsgId:(integer|null)ID of thread where to send the message.$replyMarkup:(array|null)Keyboard information.$sendAs:(integer|null)Peer to send the message as.$scheduleDate:(integer|null)Schedule date.$silent:booleanWhether to send the message silently, without triggering notifications.$noForwards:bool$background:booleanSend this message as background message$clearDraft:booleanClears the draft field$updateStickersetsOrder:booleanWhether to move used stickersets to top$forceResend:booleanWhether to forcefully resend the file, even if its type and name are the same.$cancellation:\Amp\CancellationCancellation.
See also:
\danog\MadelineProto\EventHandler\Message: Represents an incoming or outgoing message.\danog\MadelineProto\EventHandler\Media: Represents a generic media.\danog\MadelineProto\LocalFile: Indicates a local file to upload.\danog\MadelineProto\RemoteUrl: Indicates a remote URL to upload.\danog\MadelineProto\BotApiFileId: Indicates a bot API file ID to upload using sendDocument, sendPhoto etc…\Amp\ByteStream\ReadableStream\danog\MadelineProto\ParseMode: Indicates a parsing mode for text.\Amp\Cancellation
sendSticker((integer|string) $peer, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream) $file, string $mimeType, string $emoji = '', array $stickerSet = [ '_' => 'inputStickerSetEmpty',], ?callable $callback = NULL, ?string $fileName = NULL, ?int $ttl = NULL, (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, boolean $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $updateStickersetsOrder = false, boolean $forceResend = false, \Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\Message
Sends a sticker.
Please use named arguments to call this method.
Parameters:
$peer:(integer|string)Destination peer or username.$file:(\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream)File to upload: can be a message to reuse media present in a message.$mimeType:string$emoji:string$stickerSet:array$callback:?callable$fileName:?stringOptional file name, if absent will be extracted from the passed $file.$ttl:?int$replyToMsgId:(integer|null)ID of message to reply to.$topMsgId:(integer|null)ID of thread where to send the message.$replyMarkup:(array|null)Keyboard information.$sendAs:(integer|null)Peer to send the message as.$scheduleDate:(integer|null)Schedule date.$silent:booleanWhether to send the message silently, without triggering notifications.$noForwards:booleanWhether to disable forwards for this message.$background:booleanSend this message as background message$clearDraft:booleanClears the draft field$updateStickersetsOrder:booleanWhether to move used stickersets to top$forceResend:booleanWhether to forcefully resend the file, even if its type and name are the same.$cancellation:\Amp\CancellationCancellation.
See also:
\danog\MadelineProto\EventHandler\Message: Represents an incoming or outgoing message.\danog\MadelineProto\EventHandler\Media: Represents a generic media.\danog\MadelineProto\LocalFile: Indicates a local file to upload.\danog\MadelineProto\RemoteUrl: Indicates a remote URL to upload.\danog\MadelineProto\BotApiFileId: Indicates a bot API file ID to upload using sendDocument, sendPhoto etc…\Amp\ByteStream\ReadableStream\Amp\Cancellation
sendVideo((integer|string) $peer, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream) $file, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream|null) $thumb = NULL, string $caption = '', \danog\MadelineProto\ParseMode $parseMode = \danog\MadelineProto\ParseMode::TEXT, ?callable $callback = NULL, ?string $fileName = NULL, string $mimeType = 'video/mp4', (integer|null) $ttl = NULL, boolean $spoiler = false, boolean $roundMessage = false, boolean $supportsStreaming = true, boolean $noSound = false, (integer|null) $duration = NULL, (integer|null) $width = NULL, (integer|null) $height = NULL, string $thumbSeek = '00:00:01.000', (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|string|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, boolean $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $forceResend = false, bool $updateStickersetsOrder = false, \Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\Message
Sends a video.
Please use named arguments to call this method.
Parameters:
$peer:(integer|string)Destination peer or username.$file:(\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream)File to upload: can be a message to reuse media present in a message.$thumb:(\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream|null)Optional: Thumbnail to upload$caption:stringCaption of document$parseMode:\danog\MadelineProto\ParseModeText parse mode for the caption$callback:?callable$fileName:?stringOptional file name, if absent will be extracted from the passed $file.$mimeType:string$ttl:(integer|null)Time to live$spoiler:booleanWhether the message is a spoiler$roundMessage:booleanWhether the message should be round$supportsStreaming:booleanWhether the video supports streaming$noSound:booleanWhether the video has no sound$duration:(integer|null)Duration of the video$width:(integer|null)Width of the video$height:(integer|null)Height of the video$thumbSeek:string$replyToMsgId:(integer|null)ID of message to reply to.$topMsgId:(integer|null)ID of thread where to send the message.$replyMarkup:(array|null)Keyboard information.$sendAs:(integer|string|null)Peer to send the message as.$scheduleDate:(integer|null)Schedule date.$silent:booleanWhether to send the message silently, without triggering notifications.$noForwards:booleanWhether to disable forwards for this message.$background:booleanSend this message as background message$clearDraft:booleanClears the draft field$forceResend:booleanWhether to forcefully resend the file, even if its type and name are the same.$updateStickersetsOrder:bool$cancellation:\Amp\CancellationCancellation.
See also:
\danog\MadelineProto\EventHandler\Message: Represents an incoming or outgoing message.\danog\MadelineProto\EventHandler\Media: Represents a generic media.\danog\MadelineProto\LocalFile: Indicates a local file to upload.\danog\MadelineProto\RemoteUrl: Indicates a remote URL to upload.\danog\MadelineProto\BotApiFileId: Indicates a bot API file ID to upload using sendDocument, sendPhoto etc…\Amp\ByteStream\ReadableStream\danog\MadelineProto\ParseMode: Indicates a parsing mode for text.\Amp\Cancellation
sendVoice((integer|string) $peer, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream) $file, string $caption = '', \danog\MadelineProto\ParseMode $parseMode = \danog\MadelineProto\ParseMode::TEXT, ?callable $callback = NULL, ?string $fileName = NULL, (integer|null) $ttl = NULL, (integer|null) $duration = NULL, (array|null) $waveform = NULL, (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|string|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, boolean $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $forceResend = false, ?\Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\Message
Sends a voice.
Please use named arguments to call this method.
Parameters:
$peer:(integer|string)Destination peer or username.$file:(\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream)File to upload: can be a message to reuse media present in a message.$caption:stringCaption of document$parseMode:\danog\MadelineProto\ParseModeText parse mode for the caption$callback:?callable$fileName:?stringOptional file name, if absent will be extracted from the passed $file.$ttl:(integer|null)Time to live$duration:(integer|null)Duration of the voice$waveform:(array|null)Waveform of the voice$replyToMsgId:(integer|null)ID of message to reply to.$topMsgId:(integer|null)ID of thread where to send the message.$replyMarkup:(array|null)Keyboard information.$sendAs:(integer|string|null)Peer to send the message as.$scheduleDate:(integer|null)Schedule date.$silent:booleanWhether to send the message silently, without triggering notifications.$noForwards:booleanWhether to disable forwards for this message.$background:booleanSend this message as background message$clearDraft:booleanClears the draft field$forceResend:booleanWhether to forcefully resend the file, even if its type and name are the same.$cancellation:?\Amp\CancellationCancellation.
See also:
\danog\MadelineProto\EventHandler\Message: Represents an incoming or outgoing message.\danog\MadelineProto\EventHandler\Media: Represents a generic media.\danog\MadelineProto\LocalFile: Indicates a local file to upload.\danog\MadelineProto\RemoteUrl: Indicates a remote URL to upload.\danog\MadelineProto\BotApiFileId: Indicates a bot API file ID to upload using sendDocument, sendPhoto etc…\Amp\ByteStream\ReadableStream\danog\MadelineProto\ParseMode: Indicates a parsing mode for text.\Amp\Cancellation
setNoop(): void
Set NOOP update handler, ignoring all updates.
setReportPeers((int|string|array<(int|string)>) $userOrId): void
Set peer(s) where to send errors occurred in the event loop.
Parameters:
$userOrId:(int|string|array<(int|string)>)Username(s) or peer ID(s)
setWebhook(string $webhookUrl): void
Set webhook update handler.
Parameters:
$webhookUrl:stringWebhook URL
skipPlay(int $id): void
When called, skips to the next file in the playlist.
Parameters:
$id:int
sleep(float $time): void
Asynchronously sleep.
Parameters:
$time:floatNumber of seconds to sleep for
start(): array
Log in to telegram (via CLI or web).
stop(): void
Stop update loop.
stopPlay(int $id): void
Stops playing all files in the call, clears the main and the hold playlist.
Parameters:
$id:int
stringToStream(string $str): \Amp\ByteStream\ReadableBuffer
Converts a string into an async amphp stream.
Parameters:
$str:string
See also:
\Amp\ByteStream\ReadableBuffer
subscribeToUpdates(mixed $channel): bool
Subscribe to event handler updates for a channel/supergroup we’re not a member of.
Parameters:
$channel:mixedChannel/supergroup to subscribe to
Return value: False if we were already subscribed
tdToMTProto(array $params): array
Convert TD to MTProto parameters.
Parameters:
$params:arrayParameters
tdToTdcli(mixed $params): array
Convert TD parameters to tdcli.
Parameters:
$params:mixedParameters
tdcliToTd(mixed $params, array $key = NULL): array
Convert tdcli parameters to tdcli.
Parameters:
$params:mixedParams$key:arrayKey
testFibers(int $fiberCount = 100000): array{maxFibers: int, realMemoryMb: int, maps: ?int, maxMaps: ?int}
Test fibers.
Parameters:
$fiberCount:int
toCamelCase(string $input): string
Convert to camelCase.
Parameters:
$input:stringString
toSnakeCase(string $input): string
Convert to snake_case.
Parameters:
$input:stringString
unpackDouble(string $value): float
Unpack binary double.
Parameters:
$value:stringValue to unpack
unpackFileId(string $fileId): array
Unpack bot API file ID.
Parameters:
$fileId:stringBot API file ID
Return value: Unpacked file ID
unpackSignedInt(string $value): int
Unpack base256 signed int.
Parameters:
$value:stringbase256 int
unpackSignedLong(string $value): int
Unpack base256 signed long.
Parameters:
$value:stringbase256 long
unpackSignedLongString((string|int|array) $value): string
Unpack base256 signed long to string.
Parameters:
$value:(string|int|array)base256 long
unsetEventHandler(): void
Unset event handler.
update2fa(array{password?: string, new_password?: string, email?: string, hint?: string} $params): void
Update the 2FA password.
The params array can contain password, new_password, email and hint params.
Parameters:
$params:array{password?: string, new_password?: string, email?: string, hint?: string}The params
updateSettings(\danog\MadelineProto\SettingsAbstract $settings): void
Parse, update and store settings.
Parameters:
$settings:\danog\MadelineProto\SettingsAbstractSettings
See also:
\danog\MadelineProto\SettingsAbstract
upload((\danog\MadelineProto\FileCallbackInterface|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream|string|array|resource) $file, string $fileName = '', callable $cb = NULL, boolean $encrypted = false, ?\Amp\Cancellation $cancellation = NULL): array
Upload file.
Parameters:
$file:(\danog\MadelineProto\FileCallbackInterface|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream|string|array|resource)File, URL or Telegram file to upload$fileName:stringFile name$cb:callableCallback$encrypted:booleanWhether to encrypt file for secret chats$cancellation:?\Amp\Cancellation
Return value: InputFile constructor
See also:
\danog\MadelineProto\FileCallbackInterface: File callback interface.\danog\MadelineProto\LocalFile: Indicates a local file to upload.\danog\MadelineProto\RemoteUrl: Indicates a remote URL to upload.\danog\MadelineProto\BotApiFileId: Indicates a bot API file ID to upload using sendDocument, sendPhoto etc…\Amp\ByteStream\ReadableStreamresource\Amp\Cancellation
uploadAudio((\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream) $file, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream|null) $thumb = NULL, (integer|string|null) $peer = NULL, string $caption = '', \danog\MadelineProto\ParseMode $parseMode = \danog\MadelineProto\ParseMode::TEXT, ?callable $callback = NULL, ?string $fileName = NULL, ?string $mimeType = NULL, (integer|null) $duration = NULL, (string|null) $title = NULL, (string|null) $performer = NULL, ?int $ttl = NULL, (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|string|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, boolean $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $forceResend = false, ?\Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\Media
Uploads an audio without actually sending it.
Please use named arguments to call this method.
Parameters:
$file:(\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream)File to upload: can be a message to reuse media present in a message.$thumb:(\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream|null)Optional: Thumbnail to upload$peer:(integer|string|null)Optional: associate the audio to the specified peer or username.$caption:stringCaption of document$parseMode:\danog\MadelineProto\ParseModeText parse mode for the caption$callback:?callable$fileName:?stringOptional file name, if absent will be extracted from the passed $file.$mimeType:?string$duration:(integer|null)Duration of the audio$title:(string|null)Title of the audio$performer:(string|null)Performer of the audio$ttl:?int$replyToMsgId:(integer|null)ID of message to reply to.$topMsgId:(integer|null)ID of thread where to send the message.$replyMarkup:(array|null)Keyboard information.$sendAs:(integer|string|null)Peer to send the message as.$scheduleDate:(integer|null)Schedule date.$silent:booleanWhether to send the message silently, without triggering notifications.$noForwards:booleanWhether to disable forwards for this message.$background:booleanSend this message as background message$clearDraft:booleanClears the draft field$forceResend:booleanWhether to forcefully resend the file, even if its type and name are the same.$cancellation:?\Amp\CancellationCancellation.
See also:
\danog\MadelineProto\EventHandler\Message: Represents an incoming or outgoing message.\danog\MadelineProto\EventHandler\Media: Represents a generic media.\danog\MadelineProto\LocalFile: Indicates a local file to upload.\danog\MadelineProto\RemoteUrl: Indicates a remote URL to upload.\danog\MadelineProto\BotApiFileId: Indicates a bot API file ID to upload using sendDocument, sendPhoto etc…\Amp\ByteStream\ReadableStream\danog\MadelineProto\ParseMode: Indicates a parsing mode for text.\Amp\Cancellation
uploadDocument((\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream) $file, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream|null) $thumb = NULL, (integer|string|null) $peer = NULL, string $caption = '', \danog\MadelineProto\ParseMode $parseMode = \danog\MadelineProto\ParseMode::TEXT, ?callable $callback = NULL, ?string $fileName = NULL, ?string $mimeType = NULL, ?int $ttl = NULL, bool $spoiler = false, (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, bool $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $updateStickersetsOrder = false, boolean $forceResend = false, \Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\Media
Uploads a document without sending it.
Please use named arguments to call this method.
Parameters:
$file:(\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream)File to upload: can be a message to reuse media present in a message.$thumb:(\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream|null)Optional: Thumbnail to upload$peer:(integer|string|null)Optional: associate the media to the specified peer or username.$caption:stringCaption of document$parseMode:\danog\MadelineProto\ParseModeText parse mode for the caption$callback:?callable$fileName:?stringOptional file name, if absent will be extracted from the passed $file.$mimeType:?string$ttl:?int$spoiler:bool$replyToMsgId:(integer|null)ID of message to reply to.$topMsgId:(integer|null)ID of thread where to send the message.$replyMarkup:(array|null)Keyboard information.$sendAs:(integer|null)Peer to send the message as.$scheduleDate:(integer|null)Schedule date.$silent:booleanWhether to send the message silently, without triggering notifications.$noForwards:bool$background:booleanSend this message as background message$clearDraft:booleanClears the draft field$updateStickersetsOrder:booleanWhether to move used stickersets to top$forceResend:booleanWhether to forcefully resend the file, even if its type and name are the same.$cancellation:\Amp\CancellationCancellation.
See also:
\danog\MadelineProto\EventHandler\Message: Represents an incoming or outgoing message.\danog\MadelineProto\EventHandler\Media: Represents a generic media.\danog\MadelineProto\LocalFile: Indicates a local file to upload.\danog\MadelineProto\RemoteUrl: Indicates a remote URL to upload.\danog\MadelineProto\BotApiFileId: Indicates a bot API file ID to upload using sendDocument, sendPhoto etc…\Amp\ByteStream\ReadableStream\danog\MadelineProto\ParseMode: Indicates a parsing mode for text.\Amp\Cancellation
uploadDocumentPhoto((\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream) $file, (integer|string|null) $peer = NULL, string $caption = '', \danog\MadelineProto\ParseMode $parseMode = \danog\MadelineProto\ParseMode::TEXT, ?callable $callback = NULL, ?string $fileName = NULL, ?int $ttl = NULL, bool $spoiler = false, (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, bool $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $updateStickersetsOrder = false, boolean $forceResend = false, \Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\Media
Uploads a photo without sending it to the chat.
Please use named arguments to call this method.
Parameters:
$file:(\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream)File to upload: can be a message to reuse media present in a message.$peer:(integer|string|null)Optional: associate the file to the destination peer or username.$caption:stringCaption of document$parseMode:\danog\MadelineProto\ParseModeText parse mode for the caption$callback:?callable$fileName:?stringOptional file name, if absent will be extracted from the passed $file.$ttl:?int$spoiler:bool$replyToMsgId:(integer|null)ID of message to reply to.$topMsgId:(integer|null)ID of thread where to send the message.$replyMarkup:(array|null)Keyboard information.$sendAs:(integer|null)Peer to send the message as.$scheduleDate:(integer|null)Schedule date.$silent:booleanWhether to send the message silently, without triggering notifications.$noForwards:bool$background:booleanSend this message as background message$clearDraft:booleanClears the draft field$updateStickersetsOrder:booleanWhether to move used stickersets to top$forceResend:booleanWhether to forcefully resend the file, even if its type and name are the same.$cancellation:\Amp\CancellationCancellation.
See also:
\danog\MadelineProto\EventHandler\Message: Represents an incoming or outgoing message.\danog\MadelineProto\EventHandler\Media: Represents a generic media.\danog\MadelineProto\LocalFile: Indicates a local file to upload.\danog\MadelineProto\RemoteUrl: Indicates a remote URL to upload.\danog\MadelineProto\BotApiFileId: Indicates a bot API file ID to upload using sendDocument, sendPhoto etc…\Amp\ByteStream\ReadableStream\danog\MadelineProto\ParseMode: Indicates a parsing mode for text.\Amp\Cancellation
uploadEncrypted((\danog\MadelineProto\FileCallbackInterface|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|string|array|resource) $file, string $fileName = '', callable $cb = NULL, ?\Amp\Cancellation $cancellation = NULL): array
Upload file to secret chat.
Parameters:
$file:(\danog\MadelineProto\FileCallbackInterface|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|string|array|resource)File, URL or Telegram file to upload$fileName:stringFile name$cb:callableCallback$cancellation:?\Amp\Cancellation
Return value: InputFile constructor
See also:
\danog\MadelineProto\FileCallbackInterface: File callback interface.\danog\MadelineProto\LocalFile: Indicates a local file to upload.\danog\MadelineProto\RemoteUrl: Indicates a remote URL to upload.\danog\MadelineProto\BotApiFileId: Indicates a bot API file ID to upload using sendDocument, sendPhoto etc…resource\Amp\Cancellation
uploadFromCallable(callable(int, int, ?Cancellation): strin) $callable, integer $size = 0, ?string $mime = NULL, string $fileName = '', callable(float, float, float): voi) $cb = NULL, boolean $seekable = true, boolean $encrypted = false, ?\Amp\Cancellation $cancellation = NULL): array
Upload file from callable.
The callable must accept two parameters: int $offset, int $size
The callable must return a string with the contest of the file at the specified offset and size.
Parameters:
$callable:callable(int, int, ?Cancellation): strin)Callable (offset, length) => data$size:integerFile size$mime:?stringMime type$fileName:stringFile name$cb:callable(float, float, float): voi)Status callback$seekable:booleanWhether chunks can be fetched out of order$encrypted:booleanWhether to encrypt file for secret chats$cancellation:?\Amp\Cancellation
Return value: InputFile constructor
See also:
\Amp\Cancellation
uploadFromStream(mixed $stream, integer $size = 0, string $mime = NULL, string $fileName = '', callable $cb = NULL, boolean $encrypted = false, ?\Amp\Cancellation $cancellation = NULL): array
Upload file from stream.
Parameters:
$stream:mixedPHP resource or AMPHP async stream$size:integerFile size$mime:stringMime type$fileName:stringFile name$cb:callableCallback$encrypted:booleanWhether to encrypt file for secret chats$cancellation:?\Amp\Cancellation
Return value: InputFile constructor
See also:
\Amp\Cancellation
uploadFromTgfile(mixed $media, callable $cb = NULL, boolean $encrypted = false, ?\Amp\Cancellation $cancellation = NULL): array
Reupload telegram file.
Parameters:
$media:mixedTelegram file$cb:callableCallback$encrypted:booleanWhether to encrypt file for secret chats$cancellation:?\Amp\Cancellation
Return value: InputFile constructor
See also:
\Amp\Cancellation
uploadFromUrl((string|\danog\MadelineProto\FileCallbackInterface) $url, integer $size = 0, string $fileName = '', callable $cb = NULL, boolean $encrypted = false, ?\Amp\Cancellation $cancellation = NULL): array
Upload file from URL.
Parameters:
$url:(string|\danog\MadelineProto\FileCallbackInterface)URL of file$size:integerSize of file$fileName:stringFile name$cb:callableCallback$encrypted:booleanWhether to encrypt file for secret chats$cancellation:?\Amp\Cancellation
Return value: InputFile constructor
See also:
\danog\MadelineProto\FileCallbackInterface: File callback interface.\Amp\Cancellation
uploadGif((\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream) $file, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream|null) $thumb = NULL, (integer|string|null) $peer = NULL, string $caption = '', \danog\MadelineProto\ParseMode $parseMode = \danog\MadelineProto\ParseMode::TEXT, ?callable $callback = NULL, ?string $fileName = NULL, (integer|null) $ttl = NULL, boolean $spoiler = false, ?int $duration = NULL, ?int $width = NULL, ?int $height = NULL, string $thumbSeek = '00:00:01.000', (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|string|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, boolean $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $forceResend = false, ?\Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\Media
Uploads a gif without actually sending it.
Please use named arguments to call this method.
Parameters:
$file:(\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream)File to upload: can be a message to reuse media present in a message.$thumb:(\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream|null)Optional: Thumbnail to upload$peer:(integer|string|null)Optional: associate the media to the peer or username.$caption:stringCaption of document$parseMode:\danog\MadelineProto\ParseModeText parse mode for the caption$callback:?callable$fileName:?stringOptional file name, if absent will be extracted from the passed $file.$ttl:(integer|null)Time to live$spoiler:booleanWhether the message is a spoiler$duration:?int$width:?int$height:?int$thumbSeek:string$replyToMsgId:(integer|null)ID of message to reply to.$topMsgId:(integer|null)ID of thread where to send the message.$replyMarkup:(array|null)Keyboard information.$sendAs:(integer|string|null)Peer to send the message as.$scheduleDate:(integer|null)Schedule date.$silent:booleanWhether to send the message silently, without triggering notifications.$noForwards:booleanWhether to disable forwards for this message.$background:booleanSend this message as background message$clearDraft:booleanClears the draft field$forceResend:booleanWhether to forcefully resend the file, even if its type and name are the same.$cancellation:?\Amp\CancellationCancellation.
See also:
\danog\MadelineProto\EventHandler\Message: Represents an incoming or outgoing message.\danog\MadelineProto\EventHandler\Media: Represents a generic media.\danog\MadelineProto\LocalFile: Indicates a local file to upload.\danog\MadelineProto\RemoteUrl: Indicates a remote URL to upload.\danog\MadelineProto\BotApiFileId: Indicates a bot API file ID to upload using sendDocument, sendPhoto etc…\Amp\ByteStream\ReadableStream\danog\MadelineProto\ParseMode: Indicates a parsing mode for text.\Amp\Cancellation
uploadPhoto((\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream) $file, (integer|string|null) $peer = NULL, string $caption = '', \danog\MadelineProto\ParseMode $parseMode = \danog\MadelineProto\ParseMode::TEXT, ?callable $callback = NULL, ?string $fileName = NULL, ?int $ttl = NULL, bool $spoiler = false, (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, bool $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $updateStickersetsOrder = false, boolean $forceResend = false, \Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\Media
Uploads a photo, without sending it.
Please use named arguments to call this method.
Parameters:
$file:(\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream)File to upload: can be a message to reuse media present in a message.$peer:(integer|string|null)Optional: associate the media to the specified peer or username.$caption:stringCaption of document$parseMode:\danog\MadelineProto\ParseModeText parse mode for the caption$callback:?callable$fileName:?stringOptional file name, if absent will be extracted from the passed $file.$ttl:?int$spoiler:bool$replyToMsgId:(integer|null)ID of message to reply to.$topMsgId:(integer|null)ID of thread where to send the message.$replyMarkup:(array|null)Keyboard information.$sendAs:(integer|null)Peer to send the message as.$scheduleDate:(integer|null)Schedule date.$silent:booleanWhether to send the message silently, without triggering notifications.$noForwards:bool$background:booleanSend this message as background message$clearDraft:booleanClears the draft field$updateStickersetsOrder:booleanWhether to move used stickersets to top$forceResend:booleanWhether to forcefully resend the file, even if its type and name are the same.$cancellation:\Amp\CancellationCancellation.
See also:
\danog\MadelineProto\EventHandler\Message: Represents an incoming or outgoing message.\danog\MadelineProto\EventHandler\Media: Represents a generic media.\danog\MadelineProto\LocalFile: Indicates a local file to upload.\danog\MadelineProto\RemoteUrl: Indicates a remote URL to upload.\danog\MadelineProto\BotApiFileId: Indicates a bot API file ID to upload using sendDocument, sendPhoto etc…\Amp\ByteStream\ReadableStream\danog\MadelineProto\ParseMode: Indicates a parsing mode for text.\Amp\Cancellation
uploadSticker((\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream) $file, string $mimeType, (integer|string|null) $peer = NULL, string $emoji = '', array $stickerSet = [ '_' => 'inputStickerSetEmpty',], ?callable $callback = NULL, ?string $fileName = NULL, ?int $ttl = NULL, (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, boolean $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $updateStickersetsOrder = false, boolean $forceResend = false, \Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\Media
Uploads a sticker without sending it.
Please use named arguments to call this method.
Parameters:
$file:(\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream)File to upload: can be a message to reuse media present in a message.$mimeType:string$peer:(integer|string|null)Optional: associate the file to the specified peer or username.$emoji:string$stickerSet:array$callback:?callable$fileName:?stringOptional file name, if absent will be extracted from the passed $file.$ttl:?int$replyToMsgId:(integer|null)ID of message to reply to.$topMsgId:(integer|null)ID of thread where to send the message.$replyMarkup:(array|null)Keyboard information.$sendAs:(integer|null)Peer to send the message as.$scheduleDate:(integer|null)Schedule date.$silent:booleanWhether to send the message silently, without triggering notifications.$noForwards:booleanWhether to disable forwards for this message.$background:booleanSend this message as background message$clearDraft:booleanClears the draft field$updateStickersetsOrder:booleanWhether to move used stickersets to top$forceResend:booleanWhether to forcefully resend the file, even if its type and name are the same.$cancellation:\Amp\CancellationCancellation.
See also:
\danog\MadelineProto\EventHandler\Message: Represents an incoming or outgoing message.\danog\MadelineProto\EventHandler\Media: Represents a generic media.\danog\MadelineProto\LocalFile: Indicates a local file to upload.\danog\MadelineProto\RemoteUrl: Indicates a remote URL to upload.\danog\MadelineProto\BotApiFileId: Indicates a bot API file ID to upload using sendDocument, sendPhoto etc…\Amp\ByteStream\ReadableStream\Amp\Cancellation
uploadVideo((\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream) $file, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream|null) $thumb = NULL, (integer|string|null) $peer = NULL, string $caption = '', \danog\MadelineProto\ParseMode $parseMode = \danog\MadelineProto\ParseMode::TEXT, ?callable $callback = NULL, ?string $fileName = NULL, string $mimeType = 'video/mp4', (integer|null) $ttl = NULL, boolean $spoiler = false, boolean $roundMessage = false, boolean $supportsStreaming = true, boolean $noSound = false, (integer|null) $duration = NULL, (integer|null) $width = NULL, (integer|null) $height = NULL, string $thumbSeek = '00:00:01.000', (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|string|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, boolean $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $forceResend = false, bool $updateStickersetsOrder = false, \Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\Media
Uploads a video, without actually sending it.
Please use named arguments to call this method.
Parameters:
$file:(\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream)File to upload: can be a message to reuse media present in a message.$thumb:(\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream|null)Optional: Thumbnail to upload$peer:(integer|string|null)Optional: associate the media to the specified peer or username.$caption:stringCaption of document$parseMode:\danog\MadelineProto\ParseModeText parse mode for the caption$callback:?callable$fileName:?stringOptional file name, if absent will be extracted from the passed $file.$mimeType:string$ttl:(integer|null)Time to live$spoiler:booleanWhether the message is a spoiler$roundMessage:booleanWhether the message should be round$supportsStreaming:booleanWhether the video supports streaming$noSound:booleanWhether the video has no sound$duration:(integer|null)Duration of the video$width:(integer|null)Width of the video$height:(integer|null)Height of the video$thumbSeek:string$replyToMsgId:(integer|null)ID of message to reply to.$topMsgId:(integer|null)ID of thread where to send the message.$replyMarkup:(array|null)Keyboard information.$sendAs:(integer|string|null)Peer to send the message as.$scheduleDate:(integer|null)Schedule date.$silent:booleanWhether to send the message silently, without triggering notifications.$noForwards:booleanWhether to disable forwards for this message.$background:booleanSend this message as background message$clearDraft:booleanClears the draft field$forceResend:booleanWhether to forcefully resend the file, even if its type and name are the same.$updateStickersetsOrder:bool$cancellation:\Amp\CancellationCancellation.
See also:
\danog\MadelineProto\EventHandler\Message: Represents an incoming or outgoing message.\danog\MadelineProto\EventHandler\Media: Represents a generic media.\danog\MadelineProto\LocalFile: Indicates a local file to upload.\danog\MadelineProto\RemoteUrl: Indicates a remote URL to upload.\danog\MadelineProto\BotApiFileId: Indicates a bot API file ID to upload using sendDocument, sendPhoto etc…\Amp\ByteStream\ReadableStream\danog\MadelineProto\ParseMode: Indicates a parsing mode for text.\Amp\Cancellation
uploadVoice((integer|string|null) $peer, (\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream) $file, string $caption = '', \danog\MadelineProto\ParseMode $parseMode = \danog\MadelineProto\ParseMode::TEXT, ?callable $callback = NULL, ?string $fileName = NULL, (integer|null) $ttl = NULL, (integer|null) $duration = NULL, (array|null) $waveform = NULL, (integer|null) $replyToMsgId = NULL, (integer|null) $topMsgId = NULL, (array|null) $replyMarkup = NULL, (integer|string|null) $sendAs = NULL, (integer|null) $scheduleDate = NULL, boolean $silent = false, boolean $noForwards = false, boolean $background = false, boolean $clearDraft = false, boolean $forceResend = false, ?\Amp\Cancellation $cancellation = NULL): \danog\MadelineProto\EventHandler\Media
Uploads a voice without actually sending it to the chat.
Please use named arguments to call this method.
Parameters:
$peer:(integer|string|null)Optional: associate the media to the specified peer or username.$file:(\danog\MadelineProto\EventHandler\Message|\danog\MadelineProto\EventHandler\Media|\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\danog\MadelineProto\BotApiFileId|\Amp\ByteStream\ReadableStream)File to upload: can be a message to reuse media present in a message.$caption:stringCaption of document$parseMode:\danog\MadelineProto\ParseModeText parse mode for the caption$callback:?callable$fileName:?stringOptional file name, if absent will be extracted from the passed $file.$ttl:(integer|null)Time to live$duration:(integer|null)Duration of the voice$waveform:(array|null)Waveform of the voice$replyToMsgId:(integer|null)ID of message to reply to.$topMsgId:(integer|null)ID of thread where to send the message.$replyMarkup:(array|null)Keyboard information.$sendAs:(integer|string|null)Peer to send the message as.$scheduleDate:(integer|null)Schedule date.$silent:booleanWhether to send the message silently, without triggering notifications.$noForwards:booleanWhether to disable forwards for this message.$background:booleanSend this message as background message$clearDraft:booleanClears the draft field$forceResend:booleanWhether to forcefully resend the file, even if its type and name are the same.$cancellation:?\Amp\CancellationCancellation.
See also:
\danog\MadelineProto\EventHandler\Message: Represents an incoming or outgoing message.\danog\MadelineProto\EventHandler\Media: Represents a generic media.\danog\MadelineProto\LocalFile: Indicates a local file to upload.\danog\MadelineProto\RemoteUrl: Indicates a remote URL to upload.\danog\MadelineProto\BotApiFileId: Indicates a bot API file ID to upload using sendDocument, sendPhoto etc…\Amp\ByteStream\ReadableStream\danog\MadelineProto\ParseMode: Indicates a parsing mode for text.\Amp\Cancellation
validateEventHandlerClass(class-string<\danog\MadelineProto\EventHandler> $class): list<\danog\MadelineProto\EventHandlerIssue>
Perform static analysis on a certain event handler class, to make sure it satisfies some performance requirements.
Parameters:
$class:class-string<\danog\MadelineProto\EventHandler>Class name
See also:
\danog\MadelineProto\EventHandler: Event handler.\danog\MadelineProto\EventHandlerIssue: Represents an event handler issue.
viewSponsoredMessage((int|array) $peer, (string|array{random_id: string}) $message): bool
Mark sponsored message as read.
Parameters:
$peer:(int|array)Channel ID, or Update, or Message, or Peer.$message:(string|array{random_id: string})Random ID or sponsored message to mark as read.
wrapMedia(array $media, bool $protected = false): ?\danog\MadelineProto\EventHandler\Media
Wrap a media constructor into an abstract Media object.
Parameters:
$media:array$protected:bool
See also:
wrapMessage(array $message, bool $scheduled = false): ?\danog\MadelineProto\EventHandler\AbstractMessage
Wrap a Message constructor into an abstract Message object.
Parameters:
$message:array$scheduled:bool
See also:
wrapPin(array $message): ?\danog\MadelineProto\EventHandler\Pinned
Wrap a Pin constructor into an abstract Pinned object.
Parameters:
$message:array
See also:
wrapUpdate(array $update): ?\danog\MadelineProto\EventHandler\Update
Wrap an Update constructor into an abstract Update object.
Parameters:
$update:array
See also:
initDbProperties(\danog\AsyncOrm\Settings $settings, string $tablePrefix): void
Initialize database properties.
Parameters:
$settings:\danog\AsyncOrm\Settings$tablePrefix:string
See also:
\danog\AsyncOrm\Settings
saveDbProperties(): void
Save all properties.
Generated by danog/phpdoc