From e7fc3ccc5349601c05ed3521f4b897d28e444264 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Thu, 31 Aug 2023 18:50:48 +0200 Subject: [PATCH] Fix --- docs | 2 +- src/AnnotationsBuilder.php | 6 ++++++ src/DocsBuilder/Methods.php | 2 +- src/InternalDoc.php | 1 - 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs b/docs index f9479b5ed..4600ecd20 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit f9479b5ed73a5140b98bb70bb48f3c8b3e551a38 +Subproject commit 4600ecd205dfda11d056ccf772e4f5a3b92db8a3 diff --git a/src/AnnotationsBuilder.php b/src/AnnotationsBuilder.php index 8774da303..e5de70eab 100644 --- a/src/AnnotationsBuilder.php +++ b/src/AnnotationsBuilder.php @@ -535,7 +535,13 @@ final class Blacklist { \fwrite($handle, "use Amp\\Cancellation;\n"); \fwrite($handle, "use Amp\\Http\\Server\\Request as ServerRequest;\n"); \fwrite($handle, "use danog\\MadelineProto\\Broadcast\\Action;\n"); + $had = []; foreach (ClassFinder::getClassesInNamespace(\danog\MadelineProto\EventHandler::class, ClassFinder::RECURSIVE_MODE) as $class) { + $name = \basename(\str_replace('\\', '//', $class)); + if (isset($had[$name])) { + continue; + } + $had[$name] = true; \fwrite($handle, "use $class;\n"); } /** @psalm-suppress UndefinedClass */ diff --git a/src/DocsBuilder/Methods.php b/src/DocsBuilder/Methods.php index 259ad382c..47ff9e7a4 100644 --- a/src/DocsBuilder/Methods.php +++ b/src/DocsBuilder/Methods.php @@ -225,7 +225,7 @@ trait Methods $header .= "YOU CANNOT USE THIS METHOD IN MADELINEPROTO\n\n\n\n\n"; } if (\in_array($method, ['messages.getHistory', 'messages.getMessages', 'channels.getMessages'], true)) { - $header .= "# Warning: flood wait\n**Warning: this method is prone to rate limiting with flood waits, please use the [updates event handler, instead »](/docs/UPDATES.html#async-event-driven)**\n\n"; + $header .= "# Warning: flood wait\n**Warning: this method is prone to rate limiting with flood waits, **which can lead to !!! ACCOUNT BANS !!!**, please use the [updates event handler, instead (which is 100% safe) »](/docs/UPDATES.html#async-event-driven)**\n\n"; $header .= "# Warning: non-realtime results\n**Warning: this method is not suitable for receiving messages in real-time from chats and users, please use the [updates event handler, instead »](/docs/UPDATES.html#async-event-driven)**\n\n"; $header .= "# Warning: this is probably NOT what you need\nYou probably need to use the [updates event handler, instead »](/docs/UPDATES.html#async-event-driven) :)\n\n"; } diff --git a/src/InternalDoc.php b/src/InternalDoc.php index 9715a3924..3afb86b80 100644 --- a/src/InternalDoc.php +++ b/src/InternalDoc.php @@ -36,7 +36,6 @@ use danog\MadelineProto\EventHandler\Message\Entities\Spoiler; use danog\MadelineProto\EventHandler\Message\Entities\Url; use danog\MadelineProto\EventHandler\Participant\Admin; use danog\MadelineProto\EventHandler\Participant\Member; -use danog\MadelineProto\EventHandler\Participant\Rights\Admin; use danog\MadelineProto\EventHandler\Update; use danog\MadelineProto\Ipc\Client; use danog\MadelineProto\Ipc\EventHandlerProxy;