mirror of
https://github.com/danog/MadelineProto.git
synced 2024-11-30 07:18:57 +01:00
New API
This commit is contained in:
parent
f5c94fcae3
commit
2e1572ad1e
@ -53,7 +53,6 @@
|
||||
"danog/loop": "^1",
|
||||
"phpseclib/phpseclib": "^3",
|
||||
"amphp/redis": "^2",
|
||||
"symfony/polyfill-php80": "^1.18",
|
||||
"amphp/websocket-client": "^2",
|
||||
"psr/http-factory": "^1.0",
|
||||
"psr/log": "^3",
|
||||
|
@ -28,8 +28,6 @@ use ReflectionNamedType;
|
||||
use ReflectionType;
|
||||
use ReflectionUnionType;
|
||||
|
||||
use function Amp\File\read;
|
||||
|
||||
final class AnnotationsBuilder
|
||||
{
|
||||
/**
|
||||
@ -55,13 +53,16 @@ final class AnnotationsBuilder
|
||||
$tlSchema = new TLSchema;
|
||||
$tlSchema->mergeArray($settings);
|
||||
$this->TL->init($tlSchema);
|
||||
$this->blacklist = json_decode(read(__DIR__.'/../../../docs/template/disallow.json'), true);
|
||||
$this->blacklist = \json_decode(\file_get_contents(__DIR__.'/../docs/template/disallow.json'), true);
|
||||
$this->blacklistHard = $this->blacklist;
|
||||
unset($this->blacklistHard['messages.getHistory']);
|
||||
unset($this->blacklistHard['channels.getMessages']);
|
||||
unset($this->blacklistHard['updates.getDifference']);
|
||||
unset($this->blacklistHard['updates.getChannelDifference']);
|
||||
unset($this->blacklistHard['updates.getState']);
|
||||
unset($this->blacklistHard['messages.getHistory'], $this->blacklistHard['channels.getMessages'], $this->blacklistHard['updates.getDifference'], $this->blacklistHard['updates.getChannelDifference'], $this->blacklistHard['updates.getState']);
|
||||
\file_put_contents(__DIR__.'/Namespace/Blacklist.php', '<?php
|
||||
namespace danog\MadelineProto\Namespace;
|
||||
|
||||
final class Blacklist {
|
||||
public const BLACKLIST = '.\var_export($this->blacklistHard, true).';
|
||||
}
|
||||
');
|
||||
}
|
||||
public function mkAnnotations(): void
|
||||
{
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -773,20 +773,19 @@ trait PeerHandler
|
||||
/**
|
||||
* Refresh peer cache for a certain peer.
|
||||
*
|
||||
* @param mixed ...$id The peer(s) to refresh
|
||||
*/
|
||||
public function refreshPeerCache(mixed ...$ids): void
|
||||
{
|
||||
$ids = array_map(fn ($id) => $this->getInfo($id, MTProto::INFO_TYPE_ID), $ids);
|
||||
$supergroups = array_filter($ids, self::isSupergroup(...));
|
||||
$chats = array_filter($ids, fn (int $id): bool => $id < 0);
|
||||
$users = array_filter($ids, fn (int $id): bool => $id > 0);
|
||||
$ids = \array_map(fn ($id) => $this->getInfo($id, MTProto::INFO_TYPE_ID), $ids);
|
||||
$supergroups = \array_filter($ids, self::isSupergroup(...));
|
||||
$chats = \array_filter($ids, fn (int $id): bool => $id < 0);
|
||||
$users = \array_filter($ids, fn (int $id): bool => $id > 0);
|
||||
if ($supergroups) {
|
||||
$this->methodCallAsyncRead('channels.getChannels', ['id' => $supergroups]);
|
||||
}
|
||||
if ($chats) {
|
||||
$this->methodCallAsyncRead('messages.getChats', ['id' => $chats]);
|
||||
}
|
||||
}
|
||||
if ($users) {
|
||||
$this->methodCallAsyncRead('users.getUsers', ['id' => $users]);
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ declare(strict_types=1);
|
||||
namespace danog\MadelineProto\Namespace;
|
||||
|
||||
use danog\MadelineProto\APIWrapper;
|
||||
use danog\MadelineProto\Exception;
|
||||
use InvalidArgumentException;
|
||||
|
||||
/**
|
||||
@ -47,6 +48,10 @@ final class AbstractAPI
|
||||
}
|
||||
|
||||
$name = $this->namespace.'.'.$name;
|
||||
if (isset(Blacklist::BLACKLIST[$name])) {
|
||||
throw new Exception(Blacklist::BLACKLIST[$name]);
|
||||
}
|
||||
|
||||
$aargs = isset($arguments[1]) && \is_array($arguments[1]) ? $arguments[1] : [];
|
||||
$args = isset($arguments[0]) && \is_array($arguments[0]) ? $arguments[0] : [];
|
||||
if (isset($args[0]) && !isset($args['multiple'])) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/**
|
||||
* This file is automatic generated by build_docs.php file
|
||||
* and is used only for autocomplete in multiple IDE
|
||||
@ -10,7 +10,7 @@ namespace danog\MadelineProto\Namespace;
|
||||
interface Account
|
||||
{
|
||||
/**
|
||||
* Register device to receive [PUSH notifications](https://core.telegram.org/api/push-updates)
|
||||
* Register device to receive [PUSH notifications](https://core.telegram.org/api/push-updates).
|
||||
*
|
||||
* @param int $token_type Device token type.<br>**Possible values**:<br>`1` \- APNS (device token for apple push)<br>`2` \- FCM (firebase token for google firebase)<br>`3` \- MPNS (channel URI for microsoft push)<br>`4` \- Simple push (endpoint for firefox's simple push API)<br>`5` \- Ubuntu phone (token for ubuntu push)<br>`6` \- Blackberry (token for blackberry push)<br>`7` \- Unused<br>`8` \- WNS (windows push)<br>`9` \- APNS VoIP (token for apple push VoIP)<br>`10` \- Web push (web push, see below)<br>`11` \- MPNS VoIP (token for microsoft push VoIP)<br>`12` \- Tizen (token for tizen push)<br><br>For `10` web push, the token must be a JSON-encoded object containing the keys described in [PUSH updates](https://core.telegram.org/api/push-updates)
|
||||
* @param string $token Device token
|
||||
@ -18,7 +18,7 @@ interface Account
|
||||
* @param string $secret For FCM and APNS VoIP, optional encryption key used to encrypt push notifications
|
||||
* @param array $other_uids List of user identifiers of other users currently using the client @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $no_muted Avoid receiving (silent and invisible background) notifications. Useful to save battery. @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -30,7 +30,7 @@ interface Account
|
||||
* @param int $token_type Device token type.<br>**Possible values**:<br>`1` \- APNS (device token for apple push)<br>`2` \- FCM (firebase token for google firebase)<br>`3` \- MPNS (channel URI for microsoft push)<br>`4` \- Simple push (endpoint for firefox's simple push API)<br>`5` \- Ubuntu phone (token for ubuntu push)<br>`6` \- Blackberry (token for blackberry push)<br>`7` \- Unused<br>`8` \- WNS (windows push)<br>`9` \- APNS VoIP (token for apple push VoIP)<br>`10` \- Web push (web push, see below)<br>`11` \- MPNS VoIP (token for microsoft push VoIP)<br>`12` \- Tizen (token for tizen push)<br><br>For `10` web push, the token must be a JSON-encoded object containing the keys described in [PUSH updates](https://core.telegram.org/api/push-updates)
|
||||
* @param string $token Device token
|
||||
* @param array $other_uids List of user identifiers of other users currently using the client @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -41,7 +41,7 @@ interface Account
|
||||
*
|
||||
* @param array $peer Notification source @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $settings Notification settings @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -51,7 +51,7 @@ interface Account
|
||||
* Gets current notification settings for a given user/group, from all users/all groups.
|
||||
*
|
||||
* @param array $peer Notification source @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -70,7 +70,7 @@ interface Account
|
||||
* @param string $first_name New user first name
|
||||
* @param string $last_name New user last name
|
||||
* @param string $about New bio
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -80,7 +80,7 @@ interface Account
|
||||
* Updates online user status.
|
||||
*
|
||||
* @param bool $offline If [(boolTrue)](https://docs.madelineproto.xyz/API_docs/constructors/boolTrue.html) is transmitted, user status will change to [(userStatusOffline)](https://docs.madelineproto.xyz/API_docs/constructors/userStatusOffline.html).
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -90,19 +90,19 @@ interface Account
|
||||
* Returns a list of available [wallpapers](https://core.telegram.org/api/wallpapers).
|
||||
*
|
||||
* @param array $hash @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getWallPapers(array $hash = []);
|
||||
|
||||
/**
|
||||
* Report a peer for violation of telegram's Terms of Service
|
||||
* Report a peer for violation of telegram's Terms of Service.
|
||||
*
|
||||
* @param array $peer The peer to report @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $reason The reason why this peer is being reported @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param string $message Comment for report moderation
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -112,7 +112,7 @@ interface Account
|
||||
* Validates a username and checks availability.
|
||||
*
|
||||
* @param string $username username<br>Accepted characters: A-z (case-insensitive), 0-9 and underscores.<br>Length: 5-32 characters.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -122,28 +122,28 @@ interface Account
|
||||
* Changes username for the current user.
|
||||
*
|
||||
* @param string $username username or empty string if username is to be removed<br>Accepted characters: a-z (case-insensitive), 0-9 and underscores.<br>Length: 5-32 characters.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function updateUsername(string $username);
|
||||
|
||||
/**
|
||||
* Get privacy settings of current account
|
||||
* Get privacy settings of current account.
|
||||
*
|
||||
* @param array $key Peer category whose privacy settings should be fetched @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getPrivacy(array $key);
|
||||
|
||||
/**
|
||||
* Change privacy settings of current account
|
||||
* Change privacy settings of current account.
|
||||
*
|
||||
* @param array $key Peers to which the privacy rules apply @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $rules New privacy rules @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -151,52 +151,52 @@ interface Account
|
||||
|
||||
/**
|
||||
* Delete the user's account from the telegram servers.
|
||||
*
|
||||
*
|
||||
* Can also be used to delete the account of a user that provided the login code, but forgot the 2FA password and no recovery method is configured, see [here »](https://core.telegram.org/api/srp#password-recovery) for more info on password recovery, and [here »](https://core.telegram.org/api/account-deletion) for more info on account deletion.
|
||||
*
|
||||
* @param string $reason Why is the account being deleted, can be empty
|
||||
* @param array $password [2FA password](https://core.telegram.org/api/srp): this field can be omitted even for accounts with 2FA enabled: in this case account account deletion will be delayed by 7 days [as specified in the docs »](https://core.telegram.org/api/account-deletion) @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function deleteAccount(string $reason, array $password = []);
|
||||
|
||||
/**
|
||||
* Get days to live of account
|
||||
* Get days to live of account.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAccountTTL();
|
||||
|
||||
/**
|
||||
* Set account self-destruction period
|
||||
* Set account self-destruction period.
|
||||
*
|
||||
* @param array $ttl Time to live in days @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function setAccountTTL(array $ttl);
|
||||
|
||||
/**
|
||||
* Verify a new phone number to associate to the current account
|
||||
* Verify a new phone number to associate to the current account.
|
||||
*
|
||||
* @param string $phone_number New phone number
|
||||
* @param array $settings Phone code settings @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function sendChangePhoneCode(string $phone_number, array $settings);
|
||||
|
||||
/**
|
||||
* Change the phone number of the current account
|
||||
* Change the phone number of the current account.
|
||||
*
|
||||
* @param string $phone_number New phone number
|
||||
* @param string $phone_code_hash Phone code hash received when calling [account.sendChangePhoneCode](https://docs.madelineproto.xyz/API_docs/methods/account.sendChangePhoneCode.html)
|
||||
* @param string $phone_code Phone code received when calling [account.sendChangePhoneCode](https://docs.madelineproto.xyz/API_docs/methods/account.sendChangePhoneCode.html)
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -206,152 +206,152 @@ interface Account
|
||||
* When client-side passcode lock feature is enabled, will not show message texts in incoming [PUSH notifications](https://core.telegram.org/api/push-updates).
|
||||
*
|
||||
* @param int $period Inactivity period after which to start hiding message texts in [PUSH notifications](https://core.telegram.org/api/push-updates).
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function updateDeviceLocked(int $period);
|
||||
|
||||
/**
|
||||
* Get logged-in sessions
|
||||
* Get logged-in sessions.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAuthorizations();
|
||||
|
||||
/**
|
||||
* Log out an active [authorized session](https://core.telegram.org/api/auth) by its hash
|
||||
* Log out an active [authorized session](https://core.telegram.org/api/auth) by its hash.
|
||||
*
|
||||
* @param array $hash @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function resetAuthorization(array $hash = []);
|
||||
|
||||
/**
|
||||
* Obtain configuration for two-factor authorization with password
|
||||
* Obtain configuration for two-factor authorization with password.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getPassword();
|
||||
|
||||
/**
|
||||
* Send confirmation code to cancel account deletion, for more info [click here »](https://core.telegram.org/api/account-deletion)
|
||||
* Send confirmation code to cancel account deletion, for more info [click here »](https://core.telegram.org/api/account-deletion).
|
||||
*
|
||||
* @param string $hash The hash from the service notification, for more info [click here »](https://core.telegram.org/api/account-deletion)
|
||||
* @param array $settings Phone code settings @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function sendConfirmPhoneCode(string $hash, array $settings);
|
||||
|
||||
/**
|
||||
* Confirm a phone number to cancel account deletion, for more info [click here »](https://core.telegram.org/api/account-deletion)
|
||||
* Confirm a phone number to cancel account deletion, for more info [click here »](https://core.telegram.org/api/account-deletion).
|
||||
*
|
||||
* @param string $phone_code_hash Phone code hash, for more info [click here »](https://core.telegram.org/api/account-deletion)
|
||||
* @param string $phone_code SMS code, for more info [click here »](https://core.telegram.org/api/account-deletion)
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function confirmPhone(string $phone_code_hash, string $phone_code);
|
||||
|
||||
/**
|
||||
* Get temporary payment password
|
||||
* Get temporary payment password.
|
||||
*
|
||||
* @param array $password SRP password parameters @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param int $period Time during which the temporary password will be valid, in seconds; should be between 60 and 86400
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getTmpPassword(array $password, int $period);
|
||||
|
||||
/**
|
||||
* Get web [login widget](https://core.telegram.org/widgets/login) authorizations
|
||||
* Get web [login widget](https://core.telegram.org/widgets/login) authorizations.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getWebAuthorizations();
|
||||
|
||||
/**
|
||||
* Log out an active web [telegram login](https://core.telegram.org/widgets/login) session
|
||||
* Log out an active web [telegram login](https://core.telegram.org/widgets/login) session.
|
||||
*
|
||||
* @param array $hash @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function resetWebAuthorization(array $hash = []);
|
||||
|
||||
/**
|
||||
* Reset all active web [telegram login](https://core.telegram.org/widgets/login) sessions
|
||||
* Reset all active web [telegram login](https://core.telegram.org/widgets/login) sessions.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function resetWebAuthorizations();
|
||||
|
||||
/**
|
||||
* Get all saved [Telegram Passport](https://core.telegram.org/passport) documents, [for more info see the passport docs »](https://core.telegram.org/passport/encryption#encryption)
|
||||
* Get all saved [Telegram Passport](https://core.telegram.org/passport) documents, [for more info see the passport docs »](https://core.telegram.org/passport/encryption#encryption).
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAllSecureValues();
|
||||
|
||||
/**
|
||||
* Get saved [Telegram Passport](https://core.telegram.org/passport) document, [for more info see the passport docs »](https://core.telegram.org/passport/encryption#encryption)
|
||||
* Get saved [Telegram Passport](https://core.telegram.org/passport) document, [for more info see the passport docs »](https://core.telegram.org/passport/encryption#encryption).
|
||||
*
|
||||
* @param array $types Requested value types @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getSecureValue(array $types);
|
||||
|
||||
/**
|
||||
* Securely save [Telegram Passport](https://core.telegram.org/passport) document, [for more info see the passport docs »](https://core.telegram.org/passport/encryption#encryption)
|
||||
* Securely save [Telegram Passport](https://core.telegram.org/passport) document, [for more info see the passport docs »](https://core.telegram.org/passport/encryption#encryption).
|
||||
*
|
||||
* @param array $value Secure value, [for more info see the passport docs »](https://core.telegram.org/passport/encryption#encryption) @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param int $secure_secret_id Passport secret hash, [for more info see the passport docs »](https://core.telegram.org/passport/encryption#encryption)
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function saveSecureValue(array $value, int $secure_secret_id);
|
||||
|
||||
/**
|
||||
* Delete stored [Telegram Passport](https://core.telegram.org/passport) documents, [for more info see the passport docs »](https://core.telegram.org/passport/encryption#encryption)
|
||||
* Delete stored [Telegram Passport](https://core.telegram.org/passport) documents, [for more info see the passport docs »](https://core.telegram.org/passport/encryption#encryption).
|
||||
*
|
||||
* @param array $types Document types to delete @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function deleteSecureValue(array $types);
|
||||
|
||||
/**
|
||||
* Returns a Telegram Passport authorization form for sharing data with a service
|
||||
* Returns a Telegram Passport authorization form for sharing data with a service.
|
||||
*
|
||||
* @param int $bot_id User identifier of the service's bot
|
||||
* @param string $scope Telegram Passport element types requested by the service
|
||||
* @param string $public_key Service's public key
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAuthorizationForm(int $bot_id, string $scope, string $public_key);
|
||||
|
||||
/**
|
||||
* Sends a Telegram Passport authorization form, effectively sharing data with the service
|
||||
* Sends a Telegram Passport authorization form, effectively sharing data with the service.
|
||||
*
|
||||
* @param int $bot_id Bot ID
|
||||
* @param string $scope Telegram Passport element types requested by the service
|
||||
* @param string $public_key Service's public key
|
||||
* @param array $value_hashes Types of values sent and their hashes @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $credentials Encrypted values @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -362,7 +362,7 @@ interface Account
|
||||
*
|
||||
* @param string $phone_number The phone number to verify
|
||||
* @param array $settings Phone code settings @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -374,7 +374,7 @@ interface Account
|
||||
* @param string $phone_number Phone number
|
||||
* @param string $phone_code_hash Phone code hash received from the call to [account.sendVerifyPhoneCode](https://docs.madelineproto.xyz/API_docs/methods/account.sendVerifyPhoneCode.html)
|
||||
* @param string $phone_code Code received after the call to [account.sendVerifyPhoneCode](https://docs.madelineproto.xyz/API_docs/methods/account.sendVerifyPhoneCode.html)
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -385,7 +385,7 @@ interface Account
|
||||
*
|
||||
* @param array $purpose @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param string $email The email where to send the code.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -396,14 +396,14 @@ interface Account
|
||||
*
|
||||
* @param array $purpose @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $verification @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function verifyEmail(array $purpose, array $verification);
|
||||
|
||||
/**
|
||||
* Initialize account takeout session
|
||||
* Initialize account takeout session.
|
||||
*
|
||||
* @param array $contacts Whether to export contacts @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $message_users Whether to export messages in private chats @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
@ -412,17 +412,17 @@ interface Account
|
||||
* @param array $message_channels Whether to export messages in [channels](https://core.telegram.org/api/channel#channels) @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $files Whether to export files @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param int $file_max_size Maximum size of files to export
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function initTakeoutSession(array $contacts = [], array $message_users = [], array $message_chats = [], array $message_megagroups = [], array $message_channels = [], array $files = [], int $file_max_size = 0);
|
||||
|
||||
/**
|
||||
* Finish account takeout session
|
||||
* Finish account takeout session.
|
||||
*
|
||||
* @param array $success Data exported successfully @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -432,7 +432,7 @@ interface Account
|
||||
* Verify an email to use as [2FA recovery method](https://core.telegram.org/api/srp).
|
||||
*
|
||||
* @param string $code The phone code that was received after [setting a recovery email](https://core.telegram.org/api/srp#email-verification)
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -453,73 +453,73 @@ interface Account
|
||||
public function cancelPasswordEmail();
|
||||
|
||||
/**
|
||||
* Whether the user will receive notifications when contacts sign up
|
||||
* Whether the user will receive notifications when contacts sign up.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getContactSignUpNotification();
|
||||
|
||||
/**
|
||||
* Toggle contact sign up notifications
|
||||
* Toggle contact sign up notifications.
|
||||
*
|
||||
* @param bool $silent Whether to disable contact sign up notifications
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function setContactSignUpNotification(bool $silent);
|
||||
|
||||
/**
|
||||
* Returns list of chats with non-default notification settings
|
||||
* Returns list of chats with non-default notification settings.
|
||||
*
|
||||
* @param array $compare_sound If true, chats with non-default sound will also be returned @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $peer If specified, only chats of the specified category will be returned @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getNotifyExceptions(array $compare_sound = [], array $peer = []);
|
||||
|
||||
/**
|
||||
* Get info about a certain [wallpaper](https://core.telegram.org/api/wallpapers)
|
||||
* Get info about a certain [wallpaper](https://core.telegram.org/api/wallpapers).
|
||||
*
|
||||
* @param array $wallpaper The [wallpaper](https://core.telegram.org/api/wallpapers) to get info about @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getWallPaper(array $wallpaper);
|
||||
|
||||
/**
|
||||
* Create and upload a new [wallpaper](https://core.telegram.org/api/wallpapers)
|
||||
* Create and upload a new [wallpaper](https://core.telegram.org/api/wallpapers).
|
||||
*
|
||||
* @param array $file The JPG/PNG wallpaper @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param string $mime_type MIME type of uploaded wallpaper
|
||||
* @param array $settings Wallpaper settings @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function uploadWallPaper(array $file, string $mime_type, array $settings);
|
||||
|
||||
/**
|
||||
* Install/uninstall [wallpaper](https://core.telegram.org/api/wallpapers)
|
||||
* Install/uninstall [wallpaper](https://core.telegram.org/api/wallpapers).
|
||||
*
|
||||
* @param array $wallpaper [Wallpaper](https://core.telegram.org/api/wallpapers) to install or uninstall @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param bool $unsave Uninstall wallpaper?
|
||||
* @param array $settings Wallpaper settings @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function saveWallPaper(array $wallpaper, bool $unsave, array $settings);
|
||||
|
||||
/**
|
||||
* Install [wallpaper](https://core.telegram.org/api/wallpapers)
|
||||
* Install [wallpaper](https://core.telegram.org/api/wallpapers).
|
||||
*
|
||||
* @param array $wallpaper [Wallpaper](https://core.telegram.org/api/wallpapers) to install @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $settings [Wallpaper](https://core.telegram.org/api/wallpapers) settings @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -533,52 +533,52 @@ interface Account
|
||||
public function resetWallPapers();
|
||||
|
||||
/**
|
||||
* Get media autodownload settings
|
||||
* Get media autodownload settings.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAutoDownloadSettings();
|
||||
|
||||
/**
|
||||
* Change media autodownload settings
|
||||
* Change media autodownload settings.
|
||||
*
|
||||
* @param array $settings Media autodownload settings @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $low Whether to save media in the low data usage preset @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $high Whether to save media in the high data usage preset @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function saveAutoDownloadSettings(array $settings, array $low = [], array $high = []);
|
||||
|
||||
/**
|
||||
* Upload theme
|
||||
* Upload theme.
|
||||
*
|
||||
* @param array $file [Previously uploaded](https://core.telegram.org/api/themes#uploading-theme-files) theme file with platform-specific colors for UI components, can be left unset when creating themes that only modify the wallpaper or accent colors. @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param string $file_name File name
|
||||
* @param string $mime_type MIME type, must be `application/x-tgtheme-{format}`, where `format` depends on the client
|
||||
* @param array $thumb Thumbnail @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function uploadTheme(array $file, string $file_name, string $mime_type, array $thumb = []);
|
||||
|
||||
/**
|
||||
* Create a theme
|
||||
* Create a theme.
|
||||
*
|
||||
* @param string $slug Unique theme ID used to generate [theme deep links](https://core.telegram.org/api/links#theme-links), can be empty to autogenerate a random ID.
|
||||
* @param string $title Theme name
|
||||
* @param array $document Theme file @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $settings Theme settings, multiple values can be provided for the different base themes (day/night mode, etc). @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function createTheme(string $slug, string $title, array $document = [], array $settings = []);
|
||||
|
||||
/**
|
||||
* Update theme
|
||||
* Update theme.
|
||||
*
|
||||
* @param string $format Theme format, a string that identifies the theming engines supported by the client
|
||||
* @param array $theme Theme to update @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
@ -586,166 +586,166 @@ interface Account
|
||||
* @param string $title Theme name
|
||||
* @param array $document Theme file @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $settings Theme settings @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function updateTheme(string $format, array $theme, string $slug = '', string $title = '', array $document = [], array $settings = []);
|
||||
|
||||
/**
|
||||
* Save a theme
|
||||
* Save a theme.
|
||||
*
|
||||
* @param array $theme Theme to save @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param bool $unsave Unsave
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function saveTheme(array $theme, bool $unsave);
|
||||
|
||||
/**
|
||||
* Install a theme
|
||||
* Install a theme.
|
||||
*
|
||||
* @param array $dark Whether to install the dark version @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $theme Theme to install @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param string $format Theme format, a string that identifies the theming engines supported by the client
|
||||
* @param array $base_theme Indicates a basic theme provided by all clients @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function installTheme(array $dark = [], array $theme = [], string $format = '', array $base_theme = []);
|
||||
|
||||
/**
|
||||
* Get theme information
|
||||
* Get theme information.
|
||||
*
|
||||
* @param string $format Theme format, a string that identifies the theming engines supported by the client
|
||||
* @param array $theme Theme @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getTheme(string $format, array $theme);
|
||||
|
||||
/**
|
||||
* Get installed themes
|
||||
* Get installed themes.
|
||||
*
|
||||
* @param string $format Theme format, a string that identifies the theming engines supported by the client
|
||||
* @param array $hash @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getThemes(string $format, array $hash = []);
|
||||
|
||||
/**
|
||||
* Set sensitive content settings (for viewing or hiding NSFW content)
|
||||
* Set sensitive content settings (for viewing or hiding NSFW content).
|
||||
*
|
||||
* @param array $sensitive_enabled Enable NSFW content @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function setContentSettings(array $sensitive_enabled = []);
|
||||
|
||||
/**
|
||||
* Get sensitive content settings
|
||||
* Get sensitive content settings.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getContentSettings();
|
||||
|
||||
/**
|
||||
* Get info about multiple [wallpapers](https://core.telegram.org/api/wallpapers)
|
||||
* Get info about multiple [wallpapers](https://core.telegram.org/api/wallpapers).
|
||||
*
|
||||
* @param array $wallpapers [Wallpapers](https://core.telegram.org/api/wallpapers) to fetch info about @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getMultiWallPapers(array $wallpapers);
|
||||
|
||||
/**
|
||||
* Get global privacy settings
|
||||
* Get global privacy settings.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getGlobalPrivacySettings();
|
||||
|
||||
/**
|
||||
* Set global privacy settings
|
||||
* Set global privacy settings.
|
||||
*
|
||||
* @param array $settings Global privacy settings @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function setGlobalPrivacySettings(array $settings);
|
||||
|
||||
/**
|
||||
* Report a profile photo of a dialog
|
||||
* Report a profile photo of a dialog.
|
||||
*
|
||||
* @param array $peer The dialog @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $photo_id Dialog photo ID @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $reason Report reason @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param string $message Comment for report moderation
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function reportProfilePhoto(array $peer, array $photo_id, array $reason, string $message);
|
||||
|
||||
/**
|
||||
* Initiate a 2FA password reset: can only be used if the user is already logged-in, [see here for more info »](https://core.telegram.org/api/srp#password-reset)
|
||||
* Initiate a 2FA password reset: can only be used if the user is already logged-in, [see here for more info »](https://core.telegram.org/api/srp#password-reset).
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function resetPassword();
|
||||
|
||||
/**
|
||||
* Abort a pending 2FA password reset, [see here for more info »](https://core.telegram.org/api/srp#password-reset)
|
||||
* Abort a pending 2FA password reset, [see here for more info »](https://core.telegram.org/api/srp#password-reset).
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function declinePasswordReset();
|
||||
|
||||
/**
|
||||
* Get all available chat themes
|
||||
* Get all available chat themes.
|
||||
*
|
||||
* @param array $hash @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getChatThemes(array $hash = []);
|
||||
|
||||
/**
|
||||
* Set time-to-live of current session
|
||||
* Set time-to-live of current session.
|
||||
*
|
||||
* @param int $authorization_ttl_days Time-to-live of current session in days
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function setAuthorizationTTL(int $authorization_ttl_days);
|
||||
|
||||
/**
|
||||
* Change authorization settings
|
||||
* Change authorization settings.
|
||||
*
|
||||
* @param array $hash @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param bool $encrypted_requests_disabled Whether to enable or disable receiving encrypted chats: if the flag is not set, the previous setting is not changed
|
||||
* @param bool $call_requests_disabled Whether to enable or disable receiving calls: if the flag is not set, the previous setting is not changed
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function changeAuthorizationSettings(array $hash = [], bool $encrypted_requests_disabled = false, bool $call_requests_disabled = false);
|
||||
|
||||
/**
|
||||
* Fetch saved notification sounds
|
||||
* Fetch saved notification sounds.
|
||||
*
|
||||
* @param array $hash @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -753,13 +753,13 @@ interface Account
|
||||
|
||||
/**
|
||||
* Save or remove saved notification sound.
|
||||
*
|
||||
* If the notification sound is already in MP3 format, [account.savedRingtone](https://docs.madelineproto.xyz/API_docs/constructors/account.savedRingtone.html) will be returned.
|
||||
*
|
||||
* If the notification sound is already in MP3 format, [account.savedRingtone](https://docs.madelineproto.xyz/API_docs/constructors/account.savedRingtone.html) will be returned.
|
||||
* Otherwise, it will be automatically converted and a [account.savedRingtoneConverted](https://docs.madelineproto.xyz/API_docs/constructors/account.savedRingtoneConverted.html) will be returned, containing a new [document](https://docs.madelineproto.xyz/API_docs/constructors/document.html) object that should be used to refer to the ringtone from now on (ie when deleting it using the `unsave` parameter, or when downloading it).
|
||||
*
|
||||
* @param array $id Notification sound uploaded using [account.uploadRingtone](https://docs.madelineproto.xyz/API_docs/methods/account.uploadRingtone.html) @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param bool $unsave Whether to add or delete the notification sound
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -771,65 +771,63 @@ interface Account
|
||||
* @param array $file Notification sound @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param string $file_name File name
|
||||
* @param string $mime_type MIME type of file
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function uploadRingtone(array $file, string $file_name, string $mime_type);
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param array $emoji_status @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function updateEmojiStatus(array $emoji_status);
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param array $hash @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getDefaultEmojiStatuses(array $hash = []);
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param array $hash @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getRecentEmojiStatuses(array $hash = []);
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function clearRecentEmojiStatuses();
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param array $order @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function reorderUsernames(array $order);
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param string $username
|
||||
* @param bool $active
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/**
|
||||
* This file is automatic generated by build_docs.php file
|
||||
* and is used only for autocomplete in multiple IDE
|
||||
@ -11,7 +11,7 @@ interface Auth
|
||||
{
|
||||
/**
|
||||
* Terminates all user's authorized sessions except for the current one.
|
||||
*
|
||||
*
|
||||
* After calling this method it is necessary to reregister the current device using the method [account.registerDevice](https://docs.madelineproto.xyz/API_docs/methods/account.registerDevice.html)
|
||||
*
|
||||
* @return array
|
||||
@ -30,7 +30,7 @@ interface Auth
|
||||
*
|
||||
* @param string $code Code received via email
|
||||
* @param array $new_settings New password @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -41,43 +41,43 @@ interface Auth
|
||||
*
|
||||
* @param string $phone_number The phone number
|
||||
* @param string $phone_code_hash The phone code hash obtained from [auth.sendCode](https://docs.madelineproto.xyz/API_docs/methods/auth.sendCode.html)
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function resendCode(string $phone_number, string $phone_code_hash);
|
||||
|
||||
/**
|
||||
* Cancel the login verification code
|
||||
* Cancel the login verification code.
|
||||
*
|
||||
* @param string $phone_number Phone number
|
||||
* @param string $phone_code_hash Phone code hash from [auth.sendCode](https://docs.madelineproto.xyz/API_docs/methods/auth.sendCode.html)
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function cancelCode(string $phone_number, string $phone_code_hash);
|
||||
|
||||
/**
|
||||
* Delete all temporary authorization keys **except for** the ones specified
|
||||
* Delete all temporary authorization keys **except for** the ones specified.
|
||||
*
|
||||
* @param array $except_auth_keys The auth keys that **shouldn't** be dropped. @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function dropTempAuthKeys(array $except_auth_keys);
|
||||
|
||||
/**
|
||||
* Generate a login token, for [login via QR code](https://core.telegram.org/api/qr-login).
|
||||
* Generate a login token, for [login via QR code](https://core.telegram.org/api/qr-login).
|
||||
* The generated login token should be encoded using base64url, then shown as a `tg://login?token=base64encodedtoken` [deep link »](https://core.telegram.org/api/links#qr-code-login-links) in the QR code.
|
||||
*
|
||||
*
|
||||
* For more info, see [login via QR code](https://core.telegram.org/api/qr-login).
|
||||
*
|
||||
* @param int $api_id Application identifier (see. [App configuration](https://core.telegram.org/myapp))
|
||||
* @param string $api_hash Application identifier hash (see. [App configuration](https://core.telegram.org/myapp))
|
||||
* @param array $except_ids List of already logged-in user IDs, to prevent logging in twice with the same user @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -85,11 +85,11 @@ interface Auth
|
||||
|
||||
/**
|
||||
* Login using a redirected login token, generated in case of DC mismatch during [QR code login](https://core.telegram.org/api/qr-login).
|
||||
*
|
||||
*
|
||||
* For more info, see [login via QR code](https://core.telegram.org/api/qr-login).
|
||||
*
|
||||
* @param string $token Login token
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -97,13 +97,13 @@ interface Auth
|
||||
|
||||
/**
|
||||
* Accept QR code login token, logging in the app that generated it.
|
||||
*
|
||||
*
|
||||
* Returns info about the new session.
|
||||
*
|
||||
*
|
||||
* For more info, see [login via QR code](https://core.telegram.org/api/qr-login).
|
||||
*
|
||||
* @param string $token Login token embedded in QR code, for more info, see [login via QR code](https://core.telegram.org/api/qr-login).
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -113,19 +113,16 @@ interface Auth
|
||||
* Check if the [2FA recovery code](https://core.telegram.org/api/srp) sent using [auth.requestPasswordRecovery](https://docs.madelineproto.xyz/API_docs/methods/auth.requestPasswordRecovery.html) is valid, before passing it to [auth.recoverPassword](https://docs.madelineproto.xyz/API_docs/methods/auth.recoverPassword.html).
|
||||
*
|
||||
* @param string $code Code received via email
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function checkRecoveryPassword(string $code);
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param int $api_id
|
||||
* @param string $api_hash
|
||||
* @param string $web_auth_token
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/**
|
||||
* This file is automatic generated by build_docs.php file
|
||||
* and is used only for autocomplete in multiple IDE
|
||||
@ -10,67 +10,67 @@ namespace danog\MadelineProto\Namespace;
|
||||
interface Bots
|
||||
{
|
||||
/**
|
||||
* Sends a custom request; for bots only
|
||||
* Sends a custom request; for bots only.
|
||||
*
|
||||
* @param string $custom_method The method name
|
||||
* @param array $params JSON-serialized method parameters @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function sendCustomRequest(string $custom_method, array $params);
|
||||
|
||||
/**
|
||||
* Answers a custom query; for bots only
|
||||
* Answers a custom query; for bots only.
|
||||
*
|
||||
* @param int $query_id Identifier of a custom query
|
||||
* @param array $data JSON-serialized answer to the query @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function answerWebhookJSONQuery(int $query_id, array $data);
|
||||
|
||||
/**
|
||||
* Set bot command list
|
||||
* Set bot command list.
|
||||
*
|
||||
* @param array $scope Command scope @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param string $lang_code Language code
|
||||
* @param array $commands Bot commands @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function setBotCommands(array $scope, string $lang_code, array $commands);
|
||||
|
||||
/**
|
||||
* Clear bot commands for the specified bot scope and language code
|
||||
* Clear bot commands for the specified bot scope and language code.
|
||||
*
|
||||
* @param array $scope Command scope @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param string $lang_code Language code
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function resetBotCommands(array $scope, string $lang_code);
|
||||
|
||||
/**
|
||||
* Obtain a list of bot commands for the specified bot scope and language code
|
||||
* Obtain a list of bot commands for the specified bot scope and language code.
|
||||
*
|
||||
* @param array $scope Command scope @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param string $lang_code Language code
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getBotCommands(array $scope, string $lang_code);
|
||||
|
||||
/**
|
||||
* Sets the [menu button action »](https://core.telegram.org/api/bots/menu) for a given user or for all users
|
||||
* Sets the [menu button action »](https://core.telegram.org/api/bots/menu) for a given user or for all users.
|
||||
*
|
||||
* @param array $user_id User ID @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $button Bot menu button action @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -80,7 +80,7 @@ interface Bots
|
||||
* Gets the menu button action for a given user or for all users, previously set using [bots.setBotMenuButton](https://docs.madelineproto.xyz/API_docs/methods/bots.setBotMenuButton.html); users can see this information in the [botInfo](https://docs.madelineproto.xyz/API_docs/constructors/botInfo.html) constructor.
|
||||
*
|
||||
* @param array $user_id User ID or empty for the default menu button. @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -90,7 +90,7 @@ interface Bots
|
||||
* Set the default [suggested admin rights](https://core.telegram.org/api/rights#suggested-bot-rights) for bots being added as admins to channels, see [here for more info on how to handle them »](https://core.telegram.org/api/rights#suggested-bot-rights).
|
||||
*
|
||||
* @param array $admin_rights Admin rights @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -100,7 +100,7 @@ interface Bots
|
||||
* Set the default [suggested admin rights](https://core.telegram.org/api/rights#suggested-bot-rights) for bots being added as admins to groups, see [here for more info on how to handle them »](https://core.telegram.org/api/rights#suggested-bot-rights).
|
||||
*
|
||||
* @param array $admin_rights Admin rights @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/**
|
||||
* This file is automatic generated by build_docs.php file
|
||||
* and is used only for autocomplete in multiple IDE
|
||||
@ -10,59 +10,59 @@ namespace danog\MadelineProto\Namespace;
|
||||
interface Channels
|
||||
{
|
||||
/**
|
||||
* Mark [channel/supergroup](https://core.telegram.org/api/channel) history as read
|
||||
* Mark [channel/supergroup](https://core.telegram.org/api/channel) history as read.
|
||||
*
|
||||
* @param array $channel [Channel/supergroup](https://core.telegram.org/api/channel) @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param int $max_id ID of message up to which messages should be marked as read
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function readHistory(array $channel, int $max_id);
|
||||
|
||||
/**
|
||||
* Delete messages in a [channel/supergroup](https://core.telegram.org/api/channel)
|
||||
* Delete messages in a [channel/supergroup](https://core.telegram.org/api/channel).
|
||||
*
|
||||
* @param array $channel [Channel/supergroup](https://core.telegram.org/api/channel) @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $id IDs of messages to delete @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function deleteMessages(array $channel, array $id);
|
||||
|
||||
/**
|
||||
* Reports some messages from a user in a supergroup as spam; requires administrator rights in the supergroup
|
||||
* Reports some messages from a user in a supergroup as spam; requires administrator rights in the supergroup.
|
||||
*
|
||||
* @param array $channel Supergroup @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $participant Participant whose messages should be reported @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $id IDs of spam messages @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function reportSpam(array $channel, array $participant, array $id);
|
||||
|
||||
/**
|
||||
* Get the participants of a [supergroup/channel](https://core.telegram.org/api/channel)
|
||||
* Get the participants of a [supergroup/channel](https://core.telegram.org/api/channel).
|
||||
*
|
||||
* @param array $channel Channel @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $filter Which participant types to fetch @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param int $offset [Offset](https://core.telegram.org/api/offsets)
|
||||
* @param int $limit [Limit](https://core.telegram.org/api/offsets)
|
||||
* @param array $hash @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getParticipants(array $channel, array $filter, int $offset, int $limit, array $hash = []);
|
||||
|
||||
/**
|
||||
* Get info about a [channel/supergroup](https://core.telegram.org/api/channel) participant
|
||||
* Get info about a [channel/supergroup](https://core.telegram.org/api/channel) participant.
|
||||
*
|
||||
* @param array $channel Channel/supergroup @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $participant Participant to get info about @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -78,8 +78,7 @@ interface Channels
|
||||
* @param array $for_import Whether the supergroup is being created to import messages from a foreign chat service using [messages.initHistoryImport](https://docs.madelineproto.xyz/API_docs/methods/messages.initHistoryImport.html) @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $geo_point Geogroup location @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param string $address Geogroup address
|
||||
* @param int $ttl_period
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -92,116 +91,116 @@ interface Channels
|
||||
* @param array $user_id The ID of the user whose admin rights should be modified @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $admin_rights The admin rights @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param string $rank Indicates the role (rank) of the admin in the group: just an arbitrary string
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function editAdmin(array $channel, array $user_id, array $admin_rights, string $rank);
|
||||
|
||||
/**
|
||||
* Edit the name of a [channel/supergroup](https://core.telegram.org/api/channel)
|
||||
* Edit the name of a [channel/supergroup](https://core.telegram.org/api/channel).
|
||||
*
|
||||
* @param array $channel Channel/supergroup @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param string $title New name
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function editTitle(array $channel, string $title);
|
||||
|
||||
/**
|
||||
* Change the photo of a [channel/supergroup](https://core.telegram.org/api/channel)
|
||||
* Change the photo of a [channel/supergroup](https://core.telegram.org/api/channel).
|
||||
*
|
||||
* @param array $channel Channel/supergroup whose photo should be edited @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $photo New photo @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function editPhoto(array $channel, array $photo);
|
||||
|
||||
/**
|
||||
* Check if a username is free and can be assigned to a channel/supergroup
|
||||
* Check if a username is free and can be assigned to a channel/supergroup.
|
||||
*
|
||||
* @param array $channel The [channel/supergroup](https://core.telegram.org/api/channel) that will assigned the specified username @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param string $username The username to check
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function checkUsername(array $channel, string $username);
|
||||
|
||||
/**
|
||||
* Change the username of a supergroup/channel
|
||||
* Change the username of a supergroup/channel.
|
||||
*
|
||||
* @param array $channel Channel @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param string $username New username
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function updateUsername(array $channel, string $username);
|
||||
|
||||
/**
|
||||
* Join a channel/supergroup
|
||||
* Join a channel/supergroup.
|
||||
*
|
||||
* @param array $channel Channel/supergroup to join @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function joinChannel(array $channel);
|
||||
|
||||
/**
|
||||
* Leave a [channel/supergroup](https://core.telegram.org/api/channel)
|
||||
* Leave a [channel/supergroup](https://core.telegram.org/api/channel).
|
||||
*
|
||||
* @param array $channel [Channel/supergroup](https://core.telegram.org/api/channel) to leave @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function leaveChannel(array $channel);
|
||||
|
||||
/**
|
||||
* Invite users to a channel/supergroup
|
||||
* Invite users to a channel/supergroup.
|
||||
*
|
||||
* @param array $channel Channel/supergroup @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $users Users to invite @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function inviteToChannel(array $channel, array $users);
|
||||
|
||||
/**
|
||||
* Delete a [channel/supergroup](https://core.telegram.org/api/channel)
|
||||
* Delete a [channel/supergroup](https://core.telegram.org/api/channel).
|
||||
*
|
||||
* @param array $channel [Channel/supergroup](https://core.telegram.org/api/channel) to delete @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function deleteChannel(array $channel);
|
||||
|
||||
/**
|
||||
* Get link and embed info of a message in a [channel/supergroup](https://core.telegram.org/api/channel)
|
||||
* Get link and embed info of a message in a [channel/supergroup](https://core.telegram.org/api/channel).
|
||||
*
|
||||
* @param array $channel Channel @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param int $id Message ID
|
||||
* @param array $grouped Whether to include other grouped media (for albums) @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $thread Whether to also include a thread ID, if available, inside of the link @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function exportMessageLink(array $channel, int $id, array $grouped = [], array $thread = []);
|
||||
|
||||
/**
|
||||
* Enable/disable message signatures in channels
|
||||
* Enable/disable message signatures in channels.
|
||||
*
|
||||
* @param array $channel Channel @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param bool $enabled Value
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -212,7 +211,7 @@ interface Channels
|
||||
*
|
||||
* @param array $by_location Get geogroups @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $check_limit If set and the user has reached the limit of owned public [channels/supergroups/geogroups](https://core.telegram.org/api/channel), instead of returning the channel list one of the specified [errors](#possible-errors) will be returned.<br>Useful to check if a new public channel can indeed be created, even before asking the user to enter a channel username to use in [channels.checkUsername](https://docs.madelineproto.xyz/API_docs/methods/channels.checkUsername.html)/[channels.updateUsername](https://docs.madelineproto.xyz/API_docs/methods/channels.updateUsername.html). @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -224,14 +223,14 @@ interface Channels
|
||||
* @param array $channel The [supergroup/channel](https://core.telegram.org/api/channel). @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $participant Participant to ban @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $banned_rights The banned rights @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function editBanned(array $channel, array $participant, array $banned_rights);
|
||||
|
||||
/**
|
||||
* Get the admin log of a [channel/supergroup](https://core.telegram.org/api/channel)
|
||||
* Get the admin log of a [channel/supergroup](https://core.telegram.org/api/channel).
|
||||
*
|
||||
* @param array $channel Channel @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param string $q Search query, can be empty
|
||||
@ -240,62 +239,62 @@ interface Channels
|
||||
* @param int $limit Maximum number of results to return, [see pagination](https://core.telegram.org/api/offsets)
|
||||
* @param array $events_filter Event filter @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $admins Only show events from these admins @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAdminLog(array $channel, string $q, int $max_id, int $min_id, int $limit, array $events_filter = [], array $admins = []);
|
||||
|
||||
/**
|
||||
* Associate a stickerset to the supergroup
|
||||
* Associate a stickerset to the supergroup.
|
||||
*
|
||||
* @param array $channel Supergroup @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $stickerset The stickerset to associate @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function setStickers(array $channel, array $stickerset);
|
||||
|
||||
/**
|
||||
* Mark [channel/supergroup](https://core.telegram.org/api/channel) message contents as read
|
||||
* Mark [channel/supergroup](https://core.telegram.org/api/channel) message contents as read.
|
||||
*
|
||||
* @param array $channel [Channel/supergroup](https://core.telegram.org/api/channel) @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $id IDs of messages whose contents should be marked as read @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function readMessageContents(array $channel, array $id);
|
||||
|
||||
/**
|
||||
* Delete the history of a [supergroup](https://core.telegram.org/api/channel)
|
||||
* Delete the history of a [supergroup](https://core.telegram.org/api/channel).
|
||||
*
|
||||
* @param array $channel [Supergroup](https://core.telegram.org/api/channel) whose history must be deleted @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param int $max_id ID of message **up to which** the history must be deleted
|
||||
* @param array $for_everyone Whether the history should be deleted for everyone @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function deleteHistory(array $channel, int $max_id, array $for_everyone = []);
|
||||
|
||||
/**
|
||||
* Hide/unhide message history for new channel/supergroup users
|
||||
* Hide/unhide message history for new channel/supergroup users.
|
||||
*
|
||||
* @param array $channel Channel/supergroup @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param bool $enabled Hide/unhide
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function togglePreHistoryHidden(array $channel, bool $enabled);
|
||||
|
||||
/**
|
||||
* Get a list of [channels/supergroups](https://core.telegram.org/api/channel) we left
|
||||
* Get a list of [channels/supergroups](https://core.telegram.org/api/channel) we left.
|
||||
*
|
||||
* @param int $offset Offset for [pagination](https://core.telegram.org/api/offsets)
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -303,8 +302,8 @@ interface Channels
|
||||
|
||||
/**
|
||||
* Get all groups that can be used as [discussion groups](https://core.telegram.org/api/discussion).
|
||||
*
|
||||
* Returned [basic group chats](https://core.telegram.org/api/channel#basic-groups) must be first upgraded to [supergroups](https://core.telegram.org/api/channel#supergroups) before they can be set as a discussion group.
|
||||
*
|
||||
* Returned [basic group chats](https://core.telegram.org/api/channel#basic-groups) must be first upgraded to [supergroups](https://core.telegram.org/api/channel#supergroups) before they can be set as a discussion group.
|
||||
* To set a returned supergroup as a discussion group, access to its old messages must be enabled using [channels.togglePreHistoryHidden](https://docs.madelineproto.xyz/API_docs/methods/channels.togglePreHistoryHidden.html), first.
|
||||
*
|
||||
* @return array
|
||||
@ -312,53 +311,53 @@ interface Channels
|
||||
public function getGroupsForDiscussion();
|
||||
|
||||
/**
|
||||
* Associate a group to a channel as [discussion group](https://core.telegram.org/api/discussion) for that channel
|
||||
* Associate a group to a channel as [discussion group](https://core.telegram.org/api/discussion) for that channel.
|
||||
*
|
||||
* @param array $broadcast Channel @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $group [Discussion group](https://core.telegram.org/api/discussion) to associate to the channel @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function setDiscussionGroup(array $broadcast, array $group);
|
||||
|
||||
/**
|
||||
* Transfer channel ownership
|
||||
* Transfer channel ownership.
|
||||
*
|
||||
* @param array $channel Channel @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $user_id New channel owner @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $password [2FA password](https://core.telegram.org/api/srp) of account @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function editCreator(array $channel, array $user_id, array $password);
|
||||
|
||||
/**
|
||||
* Edit location of geogroup
|
||||
* Edit location of geogroup.
|
||||
*
|
||||
* @param array $channel [Geogroup](https://core.telegram.org/api/channel) @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $geo_point New geolocation @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param string $address Address string
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function editLocation(array $channel, array $geo_point, string $address);
|
||||
|
||||
/**
|
||||
* Toggle supergroup slow mode: if enabled, users will only be able to send one message every `seconds` seconds
|
||||
* Toggle supergroup slow mode: if enabled, users will only be able to send one message every `seconds` seconds.
|
||||
*
|
||||
* @param array $channel The [supergroup](https://core.telegram.org/api/channel) @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param int $seconds Users will only be able to send one message every `seconds` seconds, `0` to disable the limitation
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toggleSlowMode(array $channel, int $seconds);
|
||||
|
||||
/**
|
||||
* Get inactive channels and supergroups
|
||||
* Get inactive channels and supergroups.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -368,59 +367,59 @@ interface Channels
|
||||
* Convert a [supergroup](https://core.telegram.org/api/channel) to a [gigagroup](https://core.telegram.org/api/channel), when requested by [channel suggestions](https://core.telegram.org/api/config#channel-suggestions).
|
||||
*
|
||||
* @param array $channel The [supergroup](https://core.telegram.org/api/channel) to convert @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function convertToGigagroup(array $channel);
|
||||
|
||||
/**
|
||||
* Mark a specific sponsored message as read
|
||||
* Mark a specific sponsored message as read.
|
||||
*
|
||||
* @param array $channel Peer @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function viewSponsoredMessage(array $channel);
|
||||
|
||||
/**
|
||||
* Get a list of sponsored messages
|
||||
* Get a list of sponsored messages.
|
||||
*
|
||||
* @param array $channel Peer @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getSponsoredMessages(array $channel);
|
||||
|
||||
/**
|
||||
* Obtains a list of peers that can be used to send messages in a specific group
|
||||
* Obtains a list of peers that can be used to send messages in a specific group.
|
||||
*
|
||||
* @param array $peer The group where we intend to send messages @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getSendAs(array $peer);
|
||||
|
||||
/**
|
||||
* Delete all messages sent by a specific participant of a given supergroup
|
||||
* Delete all messages sent by a specific participant of a given supergroup.
|
||||
*
|
||||
* @param array $channel Supergroup @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $participant The participant whose messages should be deleted @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function deleteParticipantHistory(array $channel, array $participant);
|
||||
|
||||
/**
|
||||
* Set whether all users [should join a discussion group in order to comment on a post »](https://core.telegram.org/api/discussion#requiring-users-to-join-the-group)
|
||||
* Set whether all users [should join a discussion group in order to comment on a post »](https://core.telegram.org/api/discussion#requiring-users-to-join-the-group).
|
||||
*
|
||||
* @param array $channel Discussion group @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param bool $enabled Toggle
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -431,174 +430,152 @@ interface Channels
|
||||
*
|
||||
* @param array $channel Group @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param bool $enabled Toggle
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toggleJoinRequest(array $channel, bool $enabled);
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param array $channel @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $order @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function reorderUsernames(array $channel, array $order);
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param array $channel @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param string $username
|
||||
* @param bool $active
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toggleUsername(array $channel, string $username, bool $active);
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param array $channel @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function deactivateAllUsernames(array $channel);
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param array $channel @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param bool $enabled
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toggleForum(array $channel, bool $enabled);
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param array $channel @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param string $title
|
||||
* @param int $icon_color
|
||||
* @param int $icon_emoji_id
|
||||
* @param array $send_as @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function createForumTopic(array $channel, string $title, int $icon_color = 0, int $icon_emoji_id = 0, array $send_as = []);
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param array $channel @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param int $offset_date
|
||||
* @param int $offset_id
|
||||
* @param int $offset_topic
|
||||
* @param int $limit
|
||||
* @param string $q
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getForumTopics(array $channel, int $offset_date, int $offset_id, int $offset_topic, int $limit, string $q = '');
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param array $channel @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $topics @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getForumTopicsByID(array $channel, array $topics);
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param array $channel @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param int $topic_id
|
||||
* @param string $title
|
||||
* @param int $icon_emoji_id
|
||||
* @param bool $closed
|
||||
* @param bool $hidden
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function editForumTopic(array $channel, int $topic_id, string $title = '', int $icon_emoji_id = 0, bool $closed = false, bool $hidden = false);
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param array $channel @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param int $topic_id
|
||||
* @param bool $pinned
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function updatePinnedForumTopic(array $channel, int $topic_id, bool $pinned);
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param array $channel @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param int $top_msg_id
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function deleteTopicHistory(array $channel, int $top_msg_id);
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param array $channel @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $order @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $force @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function reorderPinnedForumTopics(array $channel, array $order, array $force = []);
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param array $channel @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param bool $enabled
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toggleAntiSpam(array $channel, bool $enabled);
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param array $channel @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param int $msg_id
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function reportAntiSpamFalsePositive(array $channel, int $msg_id);
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param array $channel @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param bool $enabled
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/**
|
||||
* This file is automatic generated by build_docs.php file
|
||||
* and is used only for autocomplete in multiple IDE
|
||||
@ -10,10 +10,10 @@ namespace danog\MadelineProto\Namespace;
|
||||
interface Contacts
|
||||
{
|
||||
/**
|
||||
* Get contact by telegram IDs
|
||||
* Get contact by telegram IDs.
|
||||
*
|
||||
* @param array $hash @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -30,7 +30,7 @@ interface Contacts
|
||||
* Returns the current user's contact list.
|
||||
*
|
||||
* @param array $hash @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -38,11 +38,11 @@ interface Contacts
|
||||
|
||||
/**
|
||||
* Imports contacts: saves a full list on the server, adds already registered contacts to the contact list, returns added contacts and their info.
|
||||
*
|
||||
*
|
||||
* Use [contacts.addContact](https://docs.madelineproto.xyz/API_docs/methods/contacts.addContact.html) to add Telegram contacts without actually using their phone number.
|
||||
*
|
||||
* @param array $contacts List of contacts to import @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -52,17 +52,17 @@ interface Contacts
|
||||
* Deletes several contacts from the list.
|
||||
*
|
||||
* @param array $id User ID list @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function deleteContacts(array $id);
|
||||
|
||||
/**
|
||||
* Delete contacts by phone number
|
||||
* Delete contacts by phone number.
|
||||
*
|
||||
* @param array $phones Phone numbers @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -72,7 +72,7 @@ interface Contacts
|
||||
* Adds the user to the blacklist.
|
||||
*
|
||||
* @param array $id User ID @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -82,7 +82,7 @@ interface Contacts
|
||||
* Deletes the user from the blacklist.
|
||||
*
|
||||
* @param array $id User ID @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -93,7 +93,7 @@ interface Contacts
|
||||
*
|
||||
* @param int $offset The number of list elements to be skipped
|
||||
* @param int $limit The number of list elements to be returned
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -104,14 +104,14 @@ interface Contacts
|
||||
*
|
||||
* @param string $q Target substring
|
||||
* @param int $limit Maximum number of users to be returned
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function search(string $q, int $limit);
|
||||
|
||||
/**
|
||||
* Get most used peers
|
||||
* Get most used peers.
|
||||
*
|
||||
* @param int $offset Offset for [pagination](https://core.telegram.org/api/offsets)
|
||||
* @param int $limit Maximum number of results to return, [see pagination](https://core.telegram.org/api/offsets)
|
||||
@ -124,42 +124,42 @@ interface Contacts
|
||||
* @param array $groups Often-opened groups and supergroups @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $channels Most frequently visited channels @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $hash @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getTopPeers(int $offset, int $limit, array $correspondents = [], array $bots_pm = [], array $bots_inline = [], array $phone_calls = [], array $forward_users = [], array $forward_chats = [], array $groups = [], array $channels = [], array $hash = []);
|
||||
|
||||
/**
|
||||
* Reset [rating](https://core.telegram.org/api/top-rating) of top peer
|
||||
* Reset [rating](https://core.telegram.org/api/top-rating) of top peer.
|
||||
*
|
||||
* @param array $category Top peer category @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $peer Peer whose rating should be reset @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function resetTopPeerRating(array $category, array $peer);
|
||||
|
||||
/**
|
||||
* Delete saved contacts
|
||||
* Delete saved contacts.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function resetSaved();
|
||||
|
||||
/**
|
||||
* Get all contacts
|
||||
* Get all contacts.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getSaved();
|
||||
|
||||
/**
|
||||
* Enable/disable [top peers](https://core.telegram.org/api/top-rating)
|
||||
* Enable/disable [top peers](https://core.telegram.org/api/top-rating).
|
||||
*
|
||||
* @param bool $enabled Enable/disable
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -167,7 +167,7 @@ interface Contacts
|
||||
|
||||
/**
|
||||
* Add an existing telegram user as contact.
|
||||
*
|
||||
*
|
||||
* Use [contacts.importContacts](https://docs.madelineproto.xyz/API_docs/methods/contacts.importContacts.html) to add contacts by phone number, without knowing their Telegram ID.
|
||||
*
|
||||
* @param array $id Telegram ID of the other user @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
@ -175,42 +175,42 @@ interface Contacts
|
||||
* @param string $last_name Last name
|
||||
* @param string $phone User's phone number
|
||||
* @param array $add_phone_privacy_exception Allow the other user to see our phone number? @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function addContact(array $id, string $first_name, string $last_name, string $phone, array $add_phone_privacy_exception = []);
|
||||
|
||||
/**
|
||||
* If the [peer settings](https://docs.madelineproto.xyz/API_docs/constructors/peerSettings.html) of a new user allow us to add them as contact, add that user as contact
|
||||
* If the [peer settings](https://docs.madelineproto.xyz/API_docs/constructors/peerSettings.html) of a new user allow us to add them as contact, add that user as contact.
|
||||
*
|
||||
* @param array $id The user to add as contact @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function acceptContact(array $id);
|
||||
|
||||
/**
|
||||
* Get contacts near you
|
||||
* Get contacts near you.
|
||||
*
|
||||
* @param array $geo_point Geolocation @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $background While the geolocation of the current user is public, clients should update it in the background every half-an-hour or so, while setting this flag. <br>Do this only if the new location is more than 1 KM away from the previous one, or if the previous location is unknown. @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param int $self_expires If set, the geolocation of the current user will be public for the specified number of seconds; pass 0x7fffffff to disable expiry, 0 to make the current geolocation private; if the flag isn't set, no changes will be applied.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getLocated(array $geo_point, array $background = [], int $self_expires = 0);
|
||||
|
||||
/**
|
||||
* Stop getting notifications about [thread replies](https://core.telegram.org/api/threads) of a certain user in `@replies`
|
||||
* Stop getting notifications about [thread replies](https://core.telegram.org/api/threads) of a certain user in `@replies`.
|
||||
*
|
||||
* @param int $msg_id ID of the message in the [@replies](https://core.telegram.org/api/threads#replies) chat
|
||||
* @param array $delete_message Whether to delete the specified message as well @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $delete_history Whether to delete all `@replies` messages from this user as well @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $report_spam Whether to also report this user for spam @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -220,24 +220,23 @@ interface Contacts
|
||||
* Resolve a phone number to get user info, if their privacy settings allow it.
|
||||
*
|
||||
* @param string $phone Phone number in international format, possibly obtained from a [phone number deep link](https://core.telegram.org/api/links#phone-number-links).
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function resolvePhone(string $phone);
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function exportContactToken();
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param string $token
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/**
|
||||
* This file is automatic generated by build_docs.php file
|
||||
* and is used only for autocomplete in multiple IDE
|
||||
@ -10,20 +10,20 @@ namespace danog\MadelineProto\Namespace;
|
||||
interface Folders
|
||||
{
|
||||
/**
|
||||
* Edit peers in [peer folder](https://core.telegram.org/api/folders#peer-folders)
|
||||
* Edit peers in [peer folder](https://core.telegram.org/api/folders#peer-folders).
|
||||
*
|
||||
* @param array $folder_peers New peer list @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function editPeerFolders(array $folder_peers);
|
||||
|
||||
/**
|
||||
* Delete a [peer folder](https://core.telegram.org/api/folders#peer-folders)
|
||||
* Delete a [peer folder](https://core.telegram.org/api/folders#peer-folders).
|
||||
*
|
||||
* @param int $folder_id [Peer folder ID, for more info click here](https://core.telegram.org/api/folders#peer-folders)
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/**
|
||||
* This file is automatic generated by build_docs.php file
|
||||
* and is used only for autocomplete in multiple IDE
|
||||
@ -27,7 +27,7 @@ interface Help
|
||||
* Returns information on update availability for the current application.
|
||||
*
|
||||
* @param string $source Source
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -48,22 +48,22 @@ interface Help
|
||||
public function getSupport();
|
||||
|
||||
/**
|
||||
* Get changelog of current app.
|
||||
* Get changelog of current app.
|
||||
* Typically, an [updates](https://docs.madelineproto.xyz/API_docs/constructors/updates.html) constructor will be returned, containing one or more [updateServiceNotification](https://docs.madelineproto.xyz/API_docs/constructors/updateServiceNotification.html) updates with app-specific changelogs.
|
||||
*
|
||||
* @param string $prev_app_version Previous app version
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAppChangelog(string $prev_app_version);
|
||||
|
||||
/**
|
||||
* Informs the server about the number of pending bot updates if they haven't been processed for a long time; for bots only
|
||||
* Informs the server about the number of pending bot updates if they haven't been processed for a long time; for bots only.
|
||||
*
|
||||
* @param int $pending_updates_count Number of pending updates
|
||||
* @param string $message Error message, if present
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -78,29 +78,29 @@ interface Help
|
||||
|
||||
/**
|
||||
* Get recently used `t.me` links.
|
||||
*
|
||||
* When installing official applications from "Download Telegram" buttons present in [t.me](https://t.me) pages, a referral parameter is passed to applications after installation.
|
||||
*
|
||||
* When installing official applications from "Download Telegram" buttons present in [t.me](https://t.me) pages, a referral parameter is passed to applications after installation.
|
||||
* If, after downloading the application, the user creates a new account (instead of logging into an existing one), the referral parameter should be imported using this method, which returns the [t.me](https://t.me) pages the user recently opened, before installing Telegram.
|
||||
*
|
||||
* @param string $referer Referrer
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getRecentMeUrls(string $referer);
|
||||
|
||||
/**
|
||||
* Look for updates of telegram's terms of service
|
||||
* Look for updates of telegram's terms of service.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getTermsOfServiceUpdate();
|
||||
|
||||
/**
|
||||
* Accept the new terms of service
|
||||
* Accept the new terms of service.
|
||||
*
|
||||
* @param array $id ID of terms of service @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -110,7 +110,7 @@ interface Help
|
||||
* Get info about an unsupported deep link, see [here for more info »](https://core.telegram.org/api/links#unsupported-links).
|
||||
*
|
||||
* @param string $path Path component of a `tg:` link
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -127,63 +127,62 @@ interface Help
|
||||
* Saves logs of application on the server.
|
||||
*
|
||||
* @param array $events List of input events @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function saveAppLog(array $events);
|
||||
|
||||
/**
|
||||
* Get [passport](https://core.telegram.org/passport) configuration
|
||||
* Get [passport](https://core.telegram.org/passport) configuration.
|
||||
*
|
||||
*
|
||||
* @param int $hash
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getPassportConfig(int $hash);
|
||||
|
||||
/**
|
||||
* Get localized name of the telegram support user
|
||||
* Get localized name of the telegram support user.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getSupportName();
|
||||
|
||||
/**
|
||||
* Internal use
|
||||
* Internal use.
|
||||
*
|
||||
* @param array $user_id User ID @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getUserInfo(array $user_id);
|
||||
|
||||
/**
|
||||
* Internal use
|
||||
* Internal use.
|
||||
*
|
||||
* @param array $user_id User @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param string $message Message
|
||||
* @param array $entities [Message entities for styled text](https://core.telegram.org/api/entities) @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function editUserInfo(array $user_id, string $message, array $entities);
|
||||
|
||||
/**
|
||||
* Get MTProxy/Public Service Announcement information
|
||||
* Get MTProxy/Public Service Announcement information.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getPromoData();
|
||||
|
||||
/**
|
||||
* Hide MTProxy/Public Service Announcement information
|
||||
* Hide MTProxy/Public Service Announcement information.
|
||||
*
|
||||
* @param array $peer Peer to hide @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -194,25 +193,24 @@ interface Help
|
||||
*
|
||||
* @param array $peer In the case of pending suggestions in [channels](https://docs.madelineproto.xyz/API_docs/constructors/channelFull.html), the channel ID. @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param string $suggestion [Suggestion, see here for more info »](https://core.telegram.org/api/config#suggestions).
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function dismissSuggestion(array $peer, string $suggestion);
|
||||
|
||||
/**
|
||||
* Get name, ISO code, localized name and phone codes/patterns of all available countries
|
||||
* Get name, ISO code, localized name and phone codes/patterns of all available countries.
|
||||
*
|
||||
* @param string $lang_code Language code of the current user
|
||||
* @param int $hash
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getCountriesList(string $lang_code, int $hash);
|
||||
|
||||
/**
|
||||
* Get Telegram Premium promotion information
|
||||
* Get Telegram Premium promotion information.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/**
|
||||
* This file is automatic generated by build_docs.php file
|
||||
* and is used only for autocomplete in multiple IDE
|
||||
@ -10,56 +10,56 @@ namespace danog\MadelineProto\Namespace;
|
||||
interface Langpack
|
||||
{
|
||||
/**
|
||||
* Get localization pack strings
|
||||
* Get localization pack strings.
|
||||
*
|
||||
* @param string $lang_pack Language pack name, usually obtained from a [language pack link](https://core.telegram.org/api/links#language-pack-links)
|
||||
* @param string $lang_code Language code
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getLangPack(string $lang_pack, string $lang_code);
|
||||
|
||||
/**
|
||||
* Get strings from a language pack
|
||||
* Get strings from a language pack.
|
||||
*
|
||||
* @param string $lang_pack Language pack name, usually obtained from a [language pack link](https://core.telegram.org/api/links#language-pack-links)
|
||||
* @param string $lang_code Language code
|
||||
* @param array $keys Strings to get @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getStrings(string $lang_pack, string $lang_code, array $keys);
|
||||
|
||||
/**
|
||||
* Get new strings in language pack
|
||||
* Get new strings in language pack.
|
||||
*
|
||||
* @param string $lang_pack Language pack
|
||||
* @param string $lang_code Language code
|
||||
* @param int $from_version Previous localization pack version
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getDifference(string $lang_pack, string $lang_code, int $from_version);
|
||||
|
||||
/**
|
||||
* Get information about all languages in a localization pack
|
||||
* Get information about all languages in a localization pack.
|
||||
*
|
||||
* @param string $lang_pack Language pack
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getLanguages(string $lang_pack);
|
||||
|
||||
/**
|
||||
* Get information about a language in a localization pack
|
||||
* Get information about a language in a localization pack.
|
||||
*
|
||||
* @param string $lang_pack Language pack name, usually obtained from a [language pack link](https://core.telegram.org/api/links#language-pack-links)
|
||||
* @param string $lang_code Language code
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/**
|
||||
* This file is automatic generated by build_docs.php file
|
||||
* and is used only for autocomplete in multiple IDE
|
||||
@ -10,41 +10,41 @@ namespace danog\MadelineProto\Namespace;
|
||||
interface Payments
|
||||
{
|
||||
/**
|
||||
* Get a payment form
|
||||
* Get a payment form.
|
||||
*
|
||||
* @param array $invoice Invoice @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $theme_params A JSON object with the following keys, containing color theme information (integers, RGB24) to pass to the payment provider, to apply in eventual verification pages: <br>`bg_color` \- Background color <br>`text_color` \- Text color <br>`hint_color` \- Hint text color <br>`link_color` \- Link color <br>`button_color` \- Button color <br>`button_text_color` \- Button text color @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getPaymentForm(array $invoice, array $theme_params = []);
|
||||
|
||||
/**
|
||||
* Get payment receipt
|
||||
* Get payment receipt.
|
||||
*
|
||||
* @param array $peer The peer where the payment receipt was sent @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param int $msg_id Message ID of receipt
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getPaymentReceipt(array $peer, int $msg_id);
|
||||
|
||||
/**
|
||||
* Submit requested order information for validation
|
||||
* Submit requested order information for validation.
|
||||
*
|
||||
* @param array $invoice Invoice @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $info Requested order information @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $save Save order information to re-use it for future orders @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function validateRequestedInfo(array $invoice, array $info, array $save = []);
|
||||
|
||||
/**
|
||||
* Send compiled payment form
|
||||
* Send compiled payment form.
|
||||
*
|
||||
* @param int $form_id Form ID
|
||||
* @param array $invoice Invoice @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
@ -52,45 +52,45 @@ interface Payments
|
||||
* @param string $requested_info_id ID of saved and validated [order info](https://docs.madelineproto.xyz/API_docs/constructors/payments.validatedRequestedInfo.html)
|
||||
* @param string $shipping_option_id Chosen shipping option ID
|
||||
* @param int $tip_amount Tip, in the smallest units of the currency (integer, not float/double). For example, for a price of `US$ 1.45` pass `amount = 145`. See the exp parameter in [currencies.json](https://core.telegram.org/bots/payments/currencies.json), it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function sendPaymentForm(int $form_id, array $invoice, array $credentials, string $requested_info_id = '', string $shipping_option_id = '', int $tip_amount = 0);
|
||||
|
||||
/**
|
||||
* Get saved payment information
|
||||
* Get saved payment information.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getSavedInfo();
|
||||
|
||||
/**
|
||||
* Clear saved payment information
|
||||
* Clear saved payment information.
|
||||
*
|
||||
* @param array $credentials Remove saved payment credentials @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $info Clear the last order settings saved by the user @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function clearSavedInfo(array $credentials = [], array $info = []);
|
||||
|
||||
/**
|
||||
* Get info about a credit card
|
||||
* Get info about a credit card.
|
||||
*
|
||||
* @param string $number Credit card number
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getBankCardData(string $number);
|
||||
|
||||
/**
|
||||
* Generate an [invoice deep link](https://core.telegram.org/api/links#invoice-links)
|
||||
* Generate an [invoice deep link](https://core.telegram.org/api/links#invoice-links).
|
||||
*
|
||||
* @param array $invoice_media Invoice @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -101,7 +101,7 @@ interface Payments
|
||||
*
|
||||
* @param string $receipt Receipt
|
||||
* @param array $purpose Payment purpose @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -112,7 +112,7 @@ interface Payments
|
||||
*
|
||||
* @param array $receipt Receipt @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $purpose Payment purpose @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -122,7 +122,7 @@ interface Payments
|
||||
* Checks whether Telegram Premium purchase is possible. Must be called before in-store Premium purchase, official apps only.
|
||||
*
|
||||
* @param array $purpose Payment purpose @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/**
|
||||
* This file is automatic generated by build_docs.php file
|
||||
* and is used only for autocomplete in multiple IDE
|
||||
@ -10,7 +10,7 @@ namespace danog\MadelineProto\Namespace;
|
||||
interface Phone
|
||||
{
|
||||
/**
|
||||
* Get phone call configuration to be passed to libtgvoip's shared config
|
||||
* Get phone call configuration to be passed to libtgvoip's shared config.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -20,7 +20,7 @@ interface Phone
|
||||
* Optional: notify the server that the user is currently busy in a call: this will automatically refuse all incoming phone calls until the current phone call is ended.
|
||||
*
|
||||
* @param array $peer The phone call we're currently in @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -33,49 +33,49 @@ interface Phone
|
||||
* @param int $rating Rating in `1-5` stars
|
||||
* @param string $comment An additional comment
|
||||
* @param array $user_initiative Whether the user decided on their own initiative to rate the call @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function setCallRating(array $peer, int $rating, string $comment, array $user_initiative = []);
|
||||
|
||||
/**
|
||||
* Send phone call debug data to server
|
||||
* Send phone call debug data to server.
|
||||
*
|
||||
* @param array $peer Phone call @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $debug Debug statistics obtained from libtgvoip @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function saveCallDebug(array $peer, array $debug);
|
||||
|
||||
/**
|
||||
* Send VoIP signaling data
|
||||
* Send VoIP signaling data.
|
||||
*
|
||||
* @param array $peer Phone call @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param string $data Signaling payload
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function sendSignalingData(array $peer, string $data);
|
||||
|
||||
/**
|
||||
* Create a group call or livestream
|
||||
* Create a group call or livestream.
|
||||
*
|
||||
* @param array $peer Associate the group call or livestream to the provided [group/supergroup/channel](https://core.telegram.org/api/channel) @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $rtmp_stream Whether RTMP stream support should be enabled: only the [group/supergroup/channel](https://core.telegram.org/api/channel) owner can use this flag. @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param string $title Call title
|
||||
* @param int $schedule_date For scheduled group call or livestreams, the absolute date when the group call will start
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function createGroupCall(array $peer, array $rtmp_stream = [], string $title = '', int $schedule_date = 0);
|
||||
|
||||
/**
|
||||
* Join a group call
|
||||
* Join a group call.
|
||||
*
|
||||
* @param array $call The group call @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $join_as Join the group call, presenting yourself as the specified user/channel @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
@ -83,18 +83,18 @@ interface Phone
|
||||
* @param array $muted If set, the user will be muted by default upon joining. @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $video_stopped If set, the user's video will be disabled by default upon joining. @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param string $invite_hash The invitation hash from the [invite link »](https://core.telegram.org/api/links#voice-chatvideo-chatlivestream-links), if provided allows speaking in a livestream or muted group chat.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function joinGroupCall(array $call, array $join_as, array $params, array $muted = [], array $video_stopped = [], string $invite_hash = '');
|
||||
|
||||
/**
|
||||
* Leave a group call
|
||||
* Leave a group call.
|
||||
*
|
||||
* @param array $call The group call @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param int $source Your source ID
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -105,66 +105,66 @@ interface Phone
|
||||
*
|
||||
* @param array $call The group call @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $users The users to invite. @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function inviteToGroupCall(array $call, array $users);
|
||||
|
||||
/**
|
||||
* Terminate a group call
|
||||
* Terminate a group call.
|
||||
*
|
||||
* @param array $call The group call to terminate @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function discardGroupCall(array $call);
|
||||
|
||||
/**
|
||||
* Change group call settings
|
||||
* Change group call settings.
|
||||
*
|
||||
* @param array $call Group call @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $reset_invite_hash Invalidate existing invite links @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param bool $join_muted Whether all users will that join this group call are muted by default upon joining the group call
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toggleGroupCallSettings(array $call, array $reset_invite_hash = [], bool $join_muted = false);
|
||||
|
||||
/**
|
||||
* Get info about a group call
|
||||
* Get info about a group call.
|
||||
*
|
||||
* @param array $call The group call @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param int $limit Maximum number of results to return, [see pagination](https://core.telegram.org/api/offsets)
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getGroupCall(array $call, int $limit);
|
||||
|
||||
/**
|
||||
* Get group call participants
|
||||
* Get group call participants.
|
||||
*
|
||||
* @param array $call Group call @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $ids If specified, will fetch group participant info about the specified peers @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $sources If specified, will fetch group participant info about the specified WebRTC source IDs @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param string $offset Offset for results, taken from the `next_offset` field of [phone.groupParticipants](https://docs.madelineproto.xyz/API_docs/constructors/phone.groupParticipants.html), initially an empty string. <br>Note: if no more results are available, the method call will return an empty `next_offset`; thus, avoid providing the `next_offset` returned in [phone.groupParticipants](https://docs.madelineproto.xyz/API_docs/constructors/phone.groupParticipants.html) if it is empty, to avoid an infinite loop.
|
||||
* @param int $limit Maximum number of results to return, [see pagination](https://core.telegram.org/api/offsets)
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getGroupParticipants(array $call, array $ids, array $sources, string $offset, int $limit);
|
||||
|
||||
/**
|
||||
* Check whether the group call Server Forwarding Unit is currently receiving the streams with the specified WebRTC source IDs.
|
||||
* Check whether the group call Server Forwarding Unit is currently receiving the streams with the specified WebRTC source IDs.
|
||||
* Returns an intersection of the source IDs specified in `sources`, and the source IDs currently being forwarded by the SFU.
|
||||
*
|
||||
* @param array $call Group call @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $sources Source IDs @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -178,17 +178,17 @@ interface Phone
|
||||
* @param array $video Whether to also record video streams @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param string $title Recording title
|
||||
* @param bool $video_portrait If video stream recording is enabled, whether to record in portrait or landscape mode
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toggleGroupCallRecord(array $call, array $start = [], array $video = [], string $title = '', bool $video_portrait = false);
|
||||
|
||||
/**
|
||||
* Edit information about a given group call participant
|
||||
*
|
||||
* Edit information about a given group call participant.
|
||||
*
|
||||
* Note: [flags](https://core.telegram.org/mtproto/TL-combinators#conditional-fields).N?[Bool](https://docs.madelineproto.xyz/API_docs/types/Bool.html) parameters can have three possible values:
|
||||
*
|
||||
*
|
||||
* - If the [TL flag](https://core.telegram.org/mtproto/TL-combinators#conditional-fields) is not set, the previous value will not be changed.
|
||||
* - If the [TL flag](https://core.telegram.org/mtproto/TL-combinators#conditional-fields) is set and contains a [boolTrue](https://docs.madelineproto.xyz/API_docs/constructors/boolTrue.html), the previous value will be overwritten to `true`.
|
||||
* - If the [TL flag](https://core.telegram.org/mtproto/TL-combinators#conditional-fields) is set and contains a [boolFalse](https://docs.madelineproto.xyz/API_docs/constructors/boolFalse.html), the previous value will be overwritten to `false`.
|
||||
@ -201,18 +201,18 @@ interface Phone
|
||||
* @param bool $video_stopped Start or stop the video stream
|
||||
* @param bool $video_paused Pause or resume the video stream
|
||||
* @param bool $presentation_paused Pause or resume the screen sharing stream
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function editGroupCallParticipant(array $call, array $participant, bool $muted = false, int $volume = 0, bool $raise_hand = false, bool $video_stopped = false, bool $video_paused = false, bool $presentation_paused = false);
|
||||
|
||||
/**
|
||||
* Edit the title of a group call or livestream
|
||||
* Edit the title of a group call or livestream.
|
||||
*
|
||||
* @param array $call Group call @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param string $title New title
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -222,29 +222,29 @@ interface Phone
|
||||
* Get a list of peers that can be used to join a group call, presenting yourself as a specific user/channel.
|
||||
*
|
||||
* @param array $peer The dialog whose group call or livestream we're trying to join @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getGroupCallJoinAs(array $peer);
|
||||
|
||||
/**
|
||||
* Get an [invite link](https://core.telegram.org/api/links#voice-chatvideo-chatlivestream-links) for a group call or livestream
|
||||
* Get an [invite link](https://core.telegram.org/api/links#voice-chatvideo-chatlivestream-links) for a group call or livestream.
|
||||
*
|
||||
* @param array $call The group call @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $can_self_unmute For livestreams or muted group chats, if set, users that join using this link will be able to speak without explicitly requesting permission by (for example by raising their hand). @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function exportGroupCallInvite(array $call, array $can_self_unmute = []);
|
||||
|
||||
/**
|
||||
* Subscribe or unsubscribe to a scheduled group call
|
||||
* Subscribe or unsubscribe to a scheduled group call.
|
||||
*
|
||||
* @param array $call Scheduled group call @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param bool $subscribed Enable or disable subscription
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -254,7 +254,7 @@ interface Phone
|
||||
* Start a scheduled group call.
|
||||
*
|
||||
* @param array $call The scheduled group call @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -265,40 +265,40 @@ interface Phone
|
||||
*
|
||||
* @param array $peer The dialog @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $join_as The default peer that will be used to join group calls in this dialog, presenting yourself as a specific user/channel. @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function saveDefaultGroupCallJoinAs(array $peer, array $join_as);
|
||||
|
||||
/**
|
||||
* Start screen sharing in a call
|
||||
* Start screen sharing in a call.
|
||||
*
|
||||
* @param array $call The group call @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $params WebRTC parameters @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function joinGroupCallPresentation(array $call, array $params);
|
||||
|
||||
/**
|
||||
* Stop screen sharing in a group call
|
||||
* Stop screen sharing in a group call.
|
||||
*
|
||||
* @param array $call The group call @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function leaveGroupCallPresentation(array $call);
|
||||
|
||||
/**
|
||||
* Get info about RTMP streams in a group call or livestream.
|
||||
* This method should be invoked to the same group/channel-related DC used for [downloading livestream chunks](https://core.telegram.org/api/files#downloading-files).
|
||||
* Get info about RTMP streams in a group call or livestream.
|
||||
* This method should be invoked to the same group/channel-related DC used for [downloading livestream chunks](https://core.telegram.org/api/files#downloading-files).
|
||||
* As usual, the media DC is preferred, if available.
|
||||
*
|
||||
* @param array $call Group call or livestream @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -309,18 +309,18 @@ interface Phone
|
||||
*
|
||||
* @param array $peer Peer to livestream into @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param bool $revoke Whether to revoke the previous stream key or simply return the existing one
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getGroupCallStreamRtmpUrl(array $peer, bool $revoke);
|
||||
|
||||
/**
|
||||
* Save phone call debug information
|
||||
* Save phone call debug information.
|
||||
*
|
||||
* @param array $peer Phone call @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $file Logs @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/**
|
||||
* This file is automatic generated by build_docs.php file
|
||||
* and is used only for autocomplete in multiple IDE
|
||||
@ -14,7 +14,7 @@ interface Photos
|
||||
*
|
||||
* @param array $id Input photo @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $fallback @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -27,7 +27,7 @@ interface Photos
|
||||
* @param array $file File saved in parts by means of [upload.saveFilePart](https://docs.madelineproto.xyz/API_docs/methods/upload.saveFilePart.html) method @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $video [Animated profile picture](https://core.telegram.org/api/files#animated-profile-pictures) video @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param float $video_start_ts Floating point UNIX timestamp in seconds, indicating the frame of the video that should be used as static preview.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -37,7 +37,7 @@ interface Photos
|
||||
* Deletes profile photos. The method returns a list of successfully deleted photo IDs.
|
||||
*
|
||||
* @param array $id Input photos to delete @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -50,22 +50,21 @@ interface Photos
|
||||
* @param int $offset Number of list elements to be skipped
|
||||
* @param int $max_id If a positive value was transferred, the method will return only photos with IDs less than the set one
|
||||
* @param int $limit Number of list elements to be returned
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getUserPhotos(array $user_id, int $offset, int $max_id, int $limit);
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param array $user_id @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $suggest @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $save @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $file @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $video @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param float $video_start_ts
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/**
|
||||
* This file is automatic generated by build_docs.php file
|
||||
* and is used only for autocomplete in multiple IDE
|
||||
@ -10,40 +10,40 @@ namespace danog\MadelineProto\Namespace;
|
||||
interface Stats
|
||||
{
|
||||
/**
|
||||
* Get [channel statistics](https://core.telegram.org/api/stats)
|
||||
* Get [channel statistics](https://core.telegram.org/api/stats).
|
||||
*
|
||||
* @param array $channel The channel @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $dark Whether to enable dark theme for graph colors @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getBroadcastStats(array $channel, array $dark = []);
|
||||
|
||||
/**
|
||||
* Load [channel statistics graph](https://core.telegram.org/api/stats) asynchronously
|
||||
* Load [channel statistics graph](https://core.telegram.org/api/stats) asynchronously.
|
||||
*
|
||||
* @param string $token Graph token from [statsGraphAsync](https://docs.madelineproto.xyz/API_docs/constructors/statsGraphAsync.html) constructor
|
||||
* @param int $x Zoom value, if required
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function loadAsyncGraph(string $token, int $x = 0);
|
||||
|
||||
/**
|
||||
* Get [supergroup statistics](https://core.telegram.org/api/stats)
|
||||
* Get [supergroup statistics](https://core.telegram.org/api/stats).
|
||||
*
|
||||
* @param array $channel [Supergroup ID](https://core.telegram.org/api/channel) @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $dark Whether to enable dark theme for graph colors @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getMegagroupStats(array $channel, array $dark = []);
|
||||
|
||||
/**
|
||||
* Obtains a list of messages, indicating to which other public channels was a channel message forwarded.
|
||||
* Obtains a list of messages, indicating to which other public channels was a channel message forwarded.
|
||||
* Will return a list of [messages](https://docs.madelineproto.xyz/API_docs/constructors/message.html) with `peer_id` equal to the public channel to which this message was forwarded.
|
||||
*
|
||||
* @param array $channel Source channel @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
@ -52,19 +52,19 @@ interface Stats
|
||||
* @param array $offset_peer [Offsets for pagination, for more info click here](https://core.telegram.org/api/offsets) @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param int $offset_id [Offsets for pagination, for more info click here](https://core.telegram.org/api/offsets)
|
||||
* @param int $limit Maximum number of results to return, [see pagination](https://core.telegram.org/api/offsets)
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getMessagePublicForwards(array $channel, int $msg_id, int $offset_rate, array $offset_peer, int $offset_id, int $limit);
|
||||
|
||||
/**
|
||||
* Get [message statistics](https://core.telegram.org/api/stats)
|
||||
* Get [message statistics](https://core.telegram.org/api/stats).
|
||||
*
|
||||
* @param array $channel Channel ID @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param int $msg_id Message ID
|
||||
* @param array $dark Whether to enable dark theme for graph colors @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/**
|
||||
* This file is automatic generated by build_docs.php file
|
||||
* and is used only for autocomplete in multiple IDE
|
||||
@ -21,7 +21,7 @@ interface Stickers
|
||||
* @param array $videos Whether this is a video stickerset @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $thumb Thumbnail @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param string $software Used when [importing stickers using the sticker import SDKs](https://core.telegram.org/import-stickers), specifies the name of the software that created the stickers
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -31,18 +31,18 @@ interface Stickers
|
||||
* Remove a sticker from the set where it belongs, bots only. The sticker set must have been created by the bot.
|
||||
*
|
||||
* @param array $sticker The sticker to remove @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function removeStickerFromSet(array $sticker);
|
||||
|
||||
/**
|
||||
* Changes the absolute position of a sticker in the set to which it belongs; for bots only. The sticker set must have been created by the bot
|
||||
* Changes the absolute position of a sticker in the set to which it belongs; for bots only. The sticker set must have been created by the bot.
|
||||
*
|
||||
* @param array $sticker The sticker @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param int $position The new position of the sticker, zero-based
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -53,38 +53,38 @@ interface Stickers
|
||||
*
|
||||
* @param array $stickerset The stickerset @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $sticker The sticker @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function addStickerToSet(array $stickerset, array $sticker);
|
||||
|
||||
/**
|
||||
* Set stickerset thumbnail
|
||||
* Set stickerset thumbnail.
|
||||
*
|
||||
* @param array $stickerset Stickerset @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $thumb Thumbnail @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function setStickerSetThumb(array $stickerset, array $thumb);
|
||||
|
||||
/**
|
||||
* Check whether the given short name is available
|
||||
* Check whether the given short name is available.
|
||||
*
|
||||
* @param string $short_name Short name
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function checkShortName(string $short_name);
|
||||
|
||||
/**
|
||||
* Suggests a short name for a given stickerpack name
|
||||
* Suggests a short name for a given stickerpack name.
|
||||
*
|
||||
* @param string $title Sticker pack name
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/**
|
||||
* This file is automatic generated by build_docs.php file
|
||||
* and is used only for autocomplete in multiple IDE
|
||||
@ -11,13 +11,13 @@ interface Upload
|
||||
{
|
||||
/**
|
||||
* Returns content of a web file, by proxying the request through telegram, see the [webfile docs for more info](https://core.telegram.org/api/files#downloading-webfiles).
|
||||
*
|
||||
*
|
||||
* **Note**: the query must be sent to the DC specified in the `webfile_dc_id` [MTProto configuration field](https://core.telegram.org/api/config#mtproto-configuration).
|
||||
*
|
||||
* @param array $location The file to download @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param int $offset Number of bytes to be skipped
|
||||
* @param int $limit Number of bytes to be returned
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/**
|
||||
* This file is automatic generated by build_docs.php file
|
||||
* and is used only for autocomplete in multiple IDE
|
||||
@ -11,12 +11,12 @@ interface Users
|
||||
{
|
||||
/**
|
||||
* Notify the user that the sent [passport](https://core.telegram.org/passport) data contains some errors The user will not be able to re-submit their Passport data to you until the errors are fixed (the contents of the field for which you returned the error must change).
|
||||
*
|
||||
*
|
||||
* Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues.
|
||||
*
|
||||
* @param array $id The user @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
* @param array $errors Errors @see https://docs.madelineproto.xyz/API_docs/types/array.html
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user