@@ -11,6 +11,14 @@ import dev.inmo.tgbotapi.extensions.api.chat.forum.*
1111import dev.inmo.tgbotapi.extensions.api.send.reply
1212import dev.inmo.tgbotapi.extensions.behaviour_builder.telegramBotWithBehaviourAndLongPolling
1313import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onCommand
14+ import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onForumTopicClosed
15+ import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onForumTopicCreated
16+ import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onForumTopicEdited
17+ import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onForumTopicReopened
18+ import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onGeneralForumTopicHidden
19+ import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onGeneralForumTopicUnhidden
20+ import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onPrivateForumTopicCreated
21+ import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onPrivateForumTopicEdited
1422import dev.inmo.tgbotapi.extensions.utils.forumChatOrNull
1523import dev.inmo.tgbotapi.extensions.utils.forumContentMessageOrNull
1624import dev.inmo.tgbotapi.extensions.utils.privateChatOrNull
@@ -168,9 +176,40 @@ suspend fun main(vararg args: String) {
168176 deleteForumTopic(chat, chat.id.threadId ? : return @onCommand)
169177 }
170178
179+ onCommand(" unpin_all_forum_topic_messages" ) {
180+ val chat = it.chat.forumChatOrNull() ? : return @onCommand
181+
182+ unpinAllForumTopicMessages(chat, chat.id.threadId ? : return @onCommand)
183+ }
184+
185+ onForumTopicCreated {
186+ reply(it, " Topic has been created" )
187+ }
188+ onPrivateForumTopicCreated {
189+ reply(it, " Private topic has been created" )
190+ }
191+
192+ onForumTopicEdited {
193+ reply(it, " Topic has been edited" )
194+ }
195+ onPrivateForumTopicEdited {
196+ reply(it, " Private topic has been edited" )
197+ }
198+
199+ onForumTopicReopened {
200+ reply(it, " Topic has been reopened" )
201+ }
202+ onGeneralForumTopicHidden {
203+ reply(it, " General topic has been hidden" )
204+ }
205+ onGeneralForumTopicUnhidden {
206+ reply(it, " General topic has been unhidden" )
207+ }
208+
171209 setMyCommands(
172210 BotCommand (" start_test_topics" , " start test topics" ),
173211 BotCommand (" delete_topic" , " delete topic where message have been sent" ),
212+ BotCommand (" unpin_all_forum_topic_messages" , " delete topic where message have been sent" ),
174213 scope = BotCommandScope .AllGroupChats
175214 )
176215 allUpdatesFlow.subscribeLoggingDropExceptions(this ) {
0 commit comments