mirror of
https://github.com/danog/MadelineProto.git
synced 2025-01-22 13:53:04 +01:00
Update
This commit is contained in:
parent
60a7afb6a8
commit
ae3b58b396
@ -86,7 +86,7 @@ Finally, all new bots and plugins will be automatically analyzed by MadelineProt
|
||||
|
||||
Other features:
|
||||
- Thanks to the many translation contributors @ https://weblate.madelineproto.xyz/, MadelineProto is now localized in Hebrew, Persian, Kurdish, Uzbek, Russian, French and Italian!
|
||||
- Added simplified `sendMessage`, `sendDocument`, `sendPhoto` methods that return abstract [Message](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/EventHandler/Message.html) objects with simplified properties and bound methods!
|
||||
- Added simplified [sendMessage](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/API.html#sendmessage-int-string-peer-string-message-html-markdown-null-parsemode-null-int-null-replytomsgid-null-int-null-topmsgid-null-array-null-replymarkup-null-int-null-sendas-null-int-null-scheduledate-null-bool-silent-false-bool-noforwards-false-bool-background-false-bool-cleardraft-false-bool-nowebpage-false-bool-updatestickersetsorder-false-danog-madelineproto-eventhandler-message), [sendDocument](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/API.html#senddocument-int-string-peer-message-media-danog-madelineproto-localfile-danog-madelineproto-remoteurl-danog-madelineproto-botapifileid-readablestream-file-message-media-danog-madelineproto-localfile-danog-madelineproto-remoteurl-danog-madelineproto-botapifileid-readablestream-null-thumb-null-string-caption-html-markdown-null-parsemode-null-callable-callback-null-string-filename-null-string-mimetype-null-int-ttl-null-bool-spoiler-false-int-null-replytomsgid-null-int-null-topmsgid-null-array-null-replymarkup-null-int-null-sendas-null-int-null-scheduledate-null-bool-silent-false-bool-noforwards-false-bool-background-false-bool-cleardraft-false-bool-updatestickersetsorder-false-danog-madelineproto-eventhandler-message), [sendPhoto](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/API.html#sendphoto-int-string-peer-message-media-danog-madelineproto-localfile-danog-madelineproto-remoteurl-danog-madelineproto-botapifileid-readablestream-file-string-caption-html-markdown-null-parsemode-null-callable-callback-null-string-filename-null-int-ttl-null-bool-spoiler-false-int-null-replytomsgid-null-int-null-topmsgid-null-array-null-replymarkup-null-int-null-sendas-null-int-null-scheduledate-null-bool-silent-false-bool-noforwards-false-bool-background-false-bool-cleardraft-false-bool-updatestickersetsorder-false-danog-madelineproto-eventhandler-message) methods that return abstract [Message](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/EventHandler/Message.html) objects with simplified properties and bound methods!
|
||||
- You can now use `Tools::callFork` to fork a new green thread!
|
||||
- You can now automatically pin messages broadcasted using `broadcastMessages`, `broadcastForwardMessages` by using the new `pin: true` parameter!
|
||||
- You can now use `sendMessageToAdmins` to send messages to the bot's admin (the peers returned by `getReportPeers`).
|
||||
|
2
docs
2
docs
@ -1 +1 @@
|
||||
Subproject commit 64bf195ee68d92bde6f49955ef735f58e9d6083c
|
||||
Subproject commit 833b04cc94d9ea46adbe41b0985617f1d132d9c3
|
@ -30,7 +30,9 @@ use danog\MadelineProto\EventHandler\Filter\FilterText;
|
||||
use danog\MadelineProto\EventHandler\Message;
|
||||
use danog\MadelineProto\EventHandler\SimpleFilter\FromAdmin;
|
||||
use danog\MadelineProto\EventHandler\SimpleFilter\Incoming;
|
||||
use danog\MadelineProto\LocalFile;
|
||||
use danog\MadelineProto\Logger;
|
||||
use danog\MadelineProto\RemoteUrl;
|
||||
use danog\MadelineProto\Settings;
|
||||
use danog\MadelineProto\Settings\Database\Mysql;
|
||||
use danog\MadelineProto\Settings\Database\Postgres;
|
||||
@ -59,7 +61,7 @@ class MyEventHandler extends SimpleEventHandler
|
||||
/**
|
||||
* @var int|string Username or ID of bot admin
|
||||
*/
|
||||
const ADMIN = "@danogentili"; // !!! Change this to your username !!!
|
||||
const ADMIN = "@me"; // !!! Change this to your username !!!
|
||||
|
||||
/**
|
||||
* @var array<int, bool>
|
||||
|
@ -21,13 +21,6 @@ final class Photo extends Media
|
||||
bool $protected,
|
||||
) {
|
||||
parent::__construct($API, $rawMedia, $protected);
|
||||
$hasStickers = false;
|
||||
foreach ($rawMedia['document']['attributes'] as ['_' => $t]) {
|
||||
if ($t === 'documentAttributeHasStickers') {
|
||||
$hasStickers = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$this->hasStickers = $hasStickers;
|
||||
$this->hasStickers = $rawMedia['photo']['has_stickers'];
|
||||
}
|
||||
}
|
||||
|
@ -325,9 +325,9 @@ trait FilesAbstraction
|
||||
|
||||
$params['media'] = $base;
|
||||
|
||||
return $this->methodCallAsyncRead(
|
||||
return $this->wrapMessage($this->extractMessage($this->methodCallAsyncRead(
|
||||
'messages.sendMedia',
|
||||
$params
|
||||
);
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user