1
0
mirror of https://github.com/danog/MadelineProto.git synced 2025-01-22 15:31:12 +01:00
This commit is contained in:
Alexander Pankratov 2023-05-15 11:42:49 +02:00
parent 26761f78a3
commit 8e74103b3b
3 changed files with 4 additions and 4 deletions

View File

@ -957,7 +957,7 @@ abstract class InternalDoc
*
* @param int|string|array $peer Channel ID, or Update, or Message, or Peer.
*/
public function getSponsoredMessages(array|string|int $peer): array
public function getSponsoredMessages(array|string|int $peer): ?array
{
return $this->wrapper->getAPI()->getSponsoredMessages($peer);
}

View File

@ -316,9 +316,9 @@ interface Channels
* Get a list of sponsored messages.
*
* @param array|int|string $channel Peer @see https://docs.madelineproto.xyz/API_docs/types/InputChannel.html
* @return array{_: 'messages.sponsoredMessages', posts_between: int, messages: list<array{_: 'sponsoredMessage', recommended: bool, show_peer_photo: bool, from_id?: array|int|string, chat_invite?: array{_: 'chatInviteAlready', chat: array|int|string}|array{_: 'chatInvite', photo: array{_: 'photoEmpty', id: array}|array{_: 'photo', has_stickers: array, id: array, access_hash: array, file_reference: array, date: array, sizes: list<array>, video_sizes: list<array>, dc_id: array}, channel: bool, broadcast: bool, public: bool, megagroup: bool, request_needed: bool, title: string, about: string, participants_count: int, participants: list<array|int|string>}|array{_: 'chatInvitePeek', chat: array|int|string, expires: int}, chat_invite_hash: string, channel_post: int, start_param: string, message: string, entities: list<array{_: 'messageEntityUnknown', offset: int, length: int}|array{_: 'messageEntityMention', offset: int, length: int}|array{_: 'messageEntityHashtag', offset: int, length: int}|array{_: 'messageEntityBotCommand', offset: int, length: int}|array{_: 'messageEntityUrl', offset: int, length: int}|array{_: 'messageEntityEmail', offset: int, length: int}|array{_: 'messageEntityBold', offset: int, length: int}|array{_: 'messageEntityItalic', offset: int, length: int}|array{_: 'messageEntityCode', offset: int, length: int}|array{_: 'messageEntityPre', offset: int, length: int, language: string}|array{_: 'messageEntityTextUrl', offset: int, length: int, url: string}|array{_: 'messageEntityMentionName', offset: int, length: int, user_id: int}|array{_: 'inputMessageEntityMentionName', user_id: array|int|string, offset: int, length: int}|array{_: 'messageEntityPhone', offset: int, length: int}|array{_: 'messageEntityCashtag', offset: int, length: int}|array{_: 'messageEntityUnderline', offset: int, length: int}|array{_: 'messageEntityStrike', offset: int, length: int}|array{_: 'messageEntityBlockquote', offset: int, length: int}|array{_: 'messageEntityBankCard', offset: int, length: int}|array{_: 'messageEntitySpoiler', offset: int, length: int}|array{_: 'messageEntityCustomEmoji', offset: int, length: int, document_id: int}>, sponsor_info: string, additional_info: string}>, chats: list<array|int|string>, users: list<array|int|string>}|array{_: 'messages.sponsoredMessagesEmpty'} @see https://docs.madelineproto.xyz/API_docs/types/messages.SponsoredMessages.html
* @return null|array{_: 'messages.sponsoredMessages', posts_between: int, messages: list<array{_: 'sponsoredMessage', recommended: bool, show_peer_photo: bool, from_id?: array|int|string, chat_invite?: array{_: 'chatInviteAlready', chat: array|int|string}|array{_: 'chatInvite', photo: array{_: 'photoEmpty', id: array}|array{_: 'photo', has_stickers: array, id: array, access_hash: array, file_reference: array, date: array, sizes: list<array>, video_sizes: list<array>, dc_id: array}, channel: bool, broadcast: bool, public: bool, megagroup: bool, request_needed: bool, title: string, about: string, participants_count: int, participants: list<array|int|string>}|array{_: 'chatInvitePeek', chat: array|int|string, expires: int}, chat_invite_hash: string, channel_post: int, start_param: string, message: string, entities: list<array{_: 'messageEntityUnknown', offset: int, length: int}|array{_: 'messageEntityMention', offset: int, length: int}|array{_: 'messageEntityHashtag', offset: int, length: int}|array{_: 'messageEntityBotCommand', offset: int, length: int}|array{_: 'messageEntityUrl', offset: int, length: int}|array{_: 'messageEntityEmail', offset: int, length: int}|array{_: 'messageEntityBold', offset: int, length: int}|array{_: 'messageEntityItalic', offset: int, length: int}|array{_: 'messageEntityCode', offset: int, length: int}|array{_: 'messageEntityPre', offset: int, length: int, language: string}|array{_: 'messageEntityTextUrl', offset: int, length: int, url: string}|array{_: 'messageEntityMentionName', offset: int, length: int, user_id: int}|array{_: 'inputMessageEntityMentionName', user_id: array|int|string, offset: int, length: int}|array{_: 'messageEntityPhone', offset: int, length: int}|array{_: 'messageEntityCashtag', offset: int, length: int}|array{_: 'messageEntityUnderline', offset: int, length: int}|array{_: 'messageEntityStrike', offset: int, length: int}|array{_: 'messageEntityBlockquote', offset: int, length: int}|array{_: 'messageEntityBankCard', offset: int, length: int}|array{_: 'messageEntitySpoiler', offset: int, length: int}|array{_: 'messageEntityCustomEmoji', offset: int, length: int, document_id: int}>, sponsor_info: string, additional_info: string}>, chats: list<array|int|string>, users: list<array|int|string>}|array{_: 'messages.sponsoredMessagesEmpty'} @see https://docs.madelineproto.xyz/API_docs/types/messages.SponsoredMessages.html
*/
public function getSponsoredMessages(array|int|string $channel): array;
public function getSponsoredMessages(array|int|string $channel): ?array;
/**
* Obtains a list of peers that can be used to send messages in a specific group.

View File

@ -39,7 +39,7 @@ trait Ads
*
* @param int|string|array $peer Channel ID, or Update, or Message, or Peer.
*/
public function getSponsoredMessages(int|string|array $peer): array
public function getSponsoredMessages(int|string|array $peer): ?array
{
$peer = ($this->getInfo($peer))['bot_api_id'];
$cache = $this->sponsoredMessages[$peer];