From 530cc3e40290f82868717f21f3b548e68d336f76 Mon Sep 17 00:00:00 2001 From: netkas Date: Wed, 6 Nov 2024 19:26:43 -0500 Subject: [PATCH] Add CreateForumTopic method to TgBotLib --- src/TgBotLib/Enums/Methods.php | 2 ++ src/TgBotLib/Methods/CreateForumTopic.php | 42 +++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 src/TgBotLib/Methods/CreateForumTopic.php diff --git a/src/TgBotLib/Enums/Methods.php b/src/TgBotLib/Enums/Methods.php index bf93d08..afc491a 100644 --- a/src/TgBotLib/Enums/Methods.php +++ b/src/TgBotLib/Enums/Methods.php @@ -130,6 +130,7 @@ case SET_CHAT_STICKER_SET = 'setChatStickerSet'; case DELETE_CHAT_STICKER_SET = 'deleteChatStickerSet'; case GET_FORUM_TOPIC_ICON_STICKERS = 'getForumTopicIconStickers'; + case CREATE_FORUM_TOPIC = 'createForumTopic'; /** * Executes a command on the provided bot with the given parameters. @@ -204,6 +205,7 @@ self::SET_CHAT_STICKER_SET => SetChatStickerSet::execute($bot, $parameters), self::DELETE_CHAT_STICKER_SET => DeleteChatStickerSet::execute($bot, $parameters), self::GET_FORUM_TOPIC_ICON_STICKERS => GetForumTopicIconStickers::execute($bot, $parameters), + self::CREATE_FORUM_TOPIC => CreateChatSubscriptionInviteLink::execute($bot, $parameters), }; } } diff --git a/src/TgBotLib/Methods/CreateForumTopic.php b/src/TgBotLib/Methods/CreateForumTopic.php new file mode 100644 index 0000000..f3be292 --- /dev/null +++ b/src/TgBotLib/Methods/CreateForumTopic.php @@ -0,0 +1,42 @@ +value, $parameters))); + } + + /** + * @inheritDoc + */ + public static function getRequiredParameters(): ?array + { + return [ + 'chat_id', + 'name' + ]; + } + + /** + * @inheritDoc + */ + public static function getOptionalParameters(): ?array + { + return [ + 'icon_color', + 'icon_custom_emoji_id' + ]; + } + } \ No newline at end of file