mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI-examples.git
synced 2025-12-25 15:45:38 +00:00
Compare commits
4 Commits
master
...
renovate/m
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6b61eb3716 | ||
| ab85d3acb2 | |||
| 3c3262b9cc | |||
|
|
4eda93538e |
@@ -1,21 +0,0 @@
|
|||||||
buildscript {
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: 'kotlin'
|
|
||||||
apply plugin: 'application'
|
|
||||||
|
|
||||||
mainClassName="ChecklistsBotKt"
|
|
||||||
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
||||||
|
|
||||||
implementation "dev.inmo:tgbotapi:$telegram_bot_api_version"
|
|
||||||
}
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
import dev.inmo.kslog.common.KSLog
|
|
||||||
import dev.inmo.kslog.common.LogLevel
|
|
||||||
import dev.inmo.kslog.common.defaultMessageFormatter
|
|
||||||
import dev.inmo.kslog.common.setDefaultKSLog
|
|
||||||
import dev.inmo.micro_utils.coroutines.runCatchingLogging
|
|
||||||
import dev.inmo.micro_utils.coroutines.subscribeLoggingDropExceptions
|
|
||||||
import dev.inmo.micro_utils.coroutines.subscribeSafelyWithoutExceptions
|
|
||||||
import dev.inmo.tgbotapi.extensions.api.bot.getMe
|
|
||||||
import dev.inmo.tgbotapi.extensions.api.bot.getMyStarBalance
|
|
||||||
import dev.inmo.tgbotapi.extensions.api.chat.get.getChat
|
|
||||||
import dev.inmo.tgbotapi.extensions.api.send.reply
|
|
||||||
import dev.inmo.tgbotapi.extensions.api.send.resend
|
|
||||||
import dev.inmo.tgbotapi.extensions.api.send.send
|
|
||||||
import dev.inmo.tgbotapi.extensions.api.suggested.approveSuggestedPost
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextData
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.buildSubcontextInitialAction
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitSuggestedPostApproved
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitSuggestedPostDeclined
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.telegramBotWithBehaviourAndLongPolling
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onChannelDirectMessagesConfigurationChanged
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onChecklistContent
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onChecklistTasksAdded
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onChecklistTasksDone
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onCommand
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onContentMessage
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onSuggestedPostApprovalFailed
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onSuggestedPostApproved
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onSuggestedPostDeclined
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onSuggestedPostPaid
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onSuggestedPostRefunded
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.channelDirectMessagesContentMessageOrNull
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.previewChannelDirectMessagesChatOrNull
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.suggestedChannelDirectMessagesContentMessageOrNull
|
|
||||||
import dev.inmo.tgbotapi.types.checklists.ChecklistTaskId
|
|
||||||
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
|
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.ChecklistContent
|
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
|
||||||
import dev.inmo.tgbotapi.utils.bold
|
|
||||||
import dev.inmo.tgbotapi.utils.buildEntities
|
|
||||||
import dev.inmo.tgbotapi.utils.code
|
|
||||||
import dev.inmo.tgbotapi.utils.firstOf
|
|
||||||
import kotlinx.coroutines.CoroutineScope
|
|
||||||
import kotlinx.coroutines.Dispatchers
|
|
||||||
import kotlinx.coroutines.delay
|
|
||||||
import kotlinx.coroutines.flow.filter
|
|
||||||
import kotlinx.coroutines.flow.first
|
|
||||||
|
|
||||||
suspend fun main(vararg args: String) {
|
|
||||||
val botToken = args.first()
|
|
||||||
|
|
||||||
val isDebug = args.any { it == "debug" }
|
|
||||||
val isTestServer = args.any { it == "testServer" }
|
|
||||||
|
|
||||||
if (isDebug) {
|
|
||||||
setDefaultKSLog(
|
|
||||||
KSLog { level: LogLevel, tag: String?, message: Any, throwable: Throwable? ->
|
|
||||||
println(defaultMessageFormatter(level, tag, message, throwable))
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
telegramBotWithBehaviourAndLongPolling(
|
|
||||||
botToken,
|
|
||||||
CoroutineScope(Dispatchers.Default),
|
|
||||||
testServer = isTestServer,
|
|
||||||
) {
|
|
||||||
// start here!!
|
|
||||||
val me = getMe()
|
|
||||||
println(me)
|
|
||||||
|
|
||||||
fun ChecklistContent.textBuilderTextSources(): TextSourcesList {
|
|
||||||
return buildEntities {
|
|
||||||
+checklist.textSources + "\n\n"
|
|
||||||
checklist.tasks.forEach { task ->
|
|
||||||
+"• "
|
|
||||||
code(
|
|
||||||
if (task.completionDate != null) {
|
|
||||||
"[x] "
|
|
||||||
} else {
|
|
||||||
"[ ] "
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
bold(task.textSources) + "\n"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onChecklistContent { messageWithContent ->
|
|
||||||
reply(messageWithContent) {
|
|
||||||
+messageWithContent.content.textBuilderTextSources()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onChecklistTasksDone { eventMessage ->
|
|
||||||
reply(
|
|
||||||
eventMessage,
|
|
||||||
checklistTaskId = eventMessage.chatEvent.markedAsDone ?.firstOrNull()
|
|
||||||
) {
|
|
||||||
eventMessage.chatEvent.checklistMessage.content.checklist
|
|
||||||
+eventMessage.chatEvent.checklistMessage.content.textBuilderTextSources()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onChecklistTasksAdded { messageWithContent ->
|
|
||||||
reply(
|
|
||||||
messageWithContent.chatEvent.checklistMessage,
|
|
||||||
checklistTaskId = messageWithContent.chatEvent.tasks.firstOrNull() ?.id
|
|
||||||
) {
|
|
||||||
+messageWithContent.chatEvent.checklistMessage.content.textBuilderTextSources()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
allUpdatesFlow.subscribeLoggingDropExceptions(this) {
|
|
||||||
println(it)
|
|
||||||
}
|
|
||||||
}.second.join()
|
|
||||||
}
|
|
||||||
@@ -1,13 +1,10 @@
|
|||||||
import dev.inmo.micro_utils.coroutines.awaitFirst
|
|
||||||
import dev.inmo.micro_utils.coroutines.subscribeSafelyWithoutExceptions
|
import dev.inmo.micro_utils.coroutines.subscribeSafelyWithoutExceptions
|
||||||
import dev.inmo.micro_utils.fsm.common.State
|
import dev.inmo.micro_utils.fsm.common.State
|
||||||
import dev.inmo.tgbotapi.extensions.api.send.send
|
import dev.inmo.tgbotapi.extensions.api.send.send
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitAnyContentMessage
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitAnyContentMessage
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitCommandMessage
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.telegramBotWithBehaviourAndFSMAndStartLongPolling
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.telegramBotWithBehaviourAndFSMAndStartLongPolling
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.command
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.command
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onContentMessage
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onContentMessage
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.containsCommand
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.extensions.parseCommandsWithArgs
|
import dev.inmo.tgbotapi.extensions.utils.extensions.parseCommandsWithArgs
|
||||||
import dev.inmo.tgbotapi.extensions.utils.extensions.sameThread
|
import dev.inmo.tgbotapi.extensions.utils.extensions.sameThread
|
||||||
import dev.inmo.tgbotapi.extensions.utils.textContentOrNull
|
import dev.inmo.tgbotapi.extensions.utils.textContentOrNull
|
||||||
@@ -16,12 +13,10 @@ import dev.inmo.tgbotapi.types.IdChatIdentifier
|
|||||||
import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage
|
||||||
import dev.inmo.tgbotapi.types.message.content.TextContent
|
import dev.inmo.tgbotapi.types.message.content.TextContent
|
||||||
import dev.inmo.tgbotapi.utils.botCommand
|
import dev.inmo.tgbotapi.utils.botCommand
|
||||||
import dev.inmo.tgbotapi.utils.firstOf
|
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.flow.filter
|
import kotlinx.coroutines.flow.filter
|
||||||
import kotlinx.coroutines.flow.first
|
import kotlinx.coroutines.flow.first
|
||||||
import kotlinx.coroutines.flow.map
|
|
||||||
|
|
||||||
sealed interface BotState : State
|
sealed interface BotState : State
|
||||||
data class ExpectContentOrStopState(override val context: IdChatIdentifier, val sourceMessage: CommonMessage<TextContent>) : BotState
|
data class ExpectContentOrStopState(override val context: IdChatIdentifier, val sourceMessage: CommonMessage<TextContent>) : BotState
|
||||||
@@ -53,30 +48,20 @@ suspend fun main(args: Array<String>) {
|
|||||||
+"Send me some content or " + botCommand("stop") + " if you want to stop sending"
|
+"Send me some content or " + botCommand("stop") + " if you want to stop sending"
|
||||||
}
|
}
|
||||||
|
|
||||||
val contentMessage = firstOf(
|
val contentMessage = waitAnyContentMessage().filter { message ->
|
||||||
{
|
|
||||||
waitCommandMessage("stop").filter { message ->
|
|
||||||
message.sameThread(it.sourceMessage)
|
message.sameThread(it.sourceMessage)
|
||||||
}.first()
|
}.first()
|
||||||
null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
waitAnyContentMessage().filter { message ->
|
|
||||||
message.sameThread(it.sourceMessage)
|
|
||||||
}.filter {
|
|
||||||
containsCommand(
|
|
||||||
"stop",
|
|
||||||
it.withContentOrNull<TextContent>() ?.content ?.textSources ?: return@filter false
|
|
||||||
) == false
|
|
||||||
}.first()
|
|
||||||
}
|
|
||||||
) ?: return@strictlyOn StopState(it.context)
|
|
||||||
|
|
||||||
val content = contentMessage.content
|
val content = contentMessage.content
|
||||||
|
|
||||||
|
when {
|
||||||
|
content is TextContent && content.text == "/stop"
|
||||||
|
|| content is TextContent && content.parseCommandsWithArgs().keys.contains("stop") -> StopState(it.context)
|
||||||
|
else -> {
|
||||||
execute(content.createResend(it.context))
|
execute(content.createResend(it.context))
|
||||||
it
|
it
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
strictlyOn<StopState> {
|
strictlyOn<StopState> {
|
||||||
send(it.context) { +"You have stopped sending of content" }
|
send(it.context) { +"You have stopped sending of content" }
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,4 @@
|
|||||||
import dev.inmo.kslog.common.KSLog
|
|
||||||
import dev.inmo.kslog.common.LogLevel
|
|
||||||
import dev.inmo.kslog.common.defaultMessageFormatter
|
|
||||||
import dev.inmo.kslog.common.setDefaultKSLog
|
|
||||||
|
|
||||||
suspend fun main(args: Array<String>) {
|
suspend fun main(args: Array<String>) {
|
||||||
val isDebug = args.getOrNull(1) == "debug"
|
|
||||||
|
|
||||||
if (isDebug) {
|
|
||||||
setDefaultKSLog(
|
|
||||||
KSLog { level: LogLevel, tag: String?, message: Any, throwable: Throwable? ->
|
|
||||||
println(defaultMessageFormatter(level, tag, message, throwable))
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
activateResenderBot(args.first()) {
|
activateResenderBot(args.first()) {
|
||||||
println(it)
|
println(it)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# StarTransactionsBot
|
# CustomBot
|
||||||
|
|
||||||
This bot basically have no any useful behaviour, but you may customize it as a playground
|
This bot basically have no any useful behaviour, but you may customize it as a playground
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
# StickerSetHandler
|
|
||||||
|
|
||||||
Send sticker to this bot to form your own stickers set. Send /delete to delete this sticker set
|
|
||||||
|
|
||||||
## How to run
|
|
||||||
|
|
||||||
```bash
|
|
||||||
./gradlew run --args="TOKEN"
|
|
||||||
```
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
buildscript {
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: 'kotlin'
|
|
||||||
apply plugin: 'application'
|
|
||||||
|
|
||||||
mainClassName="SuggestedPostsBotKt"
|
|
||||||
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
||||||
|
|
||||||
implementation "dev.inmo:tgbotapi:$telegram_bot_api_version"
|
|
||||||
}
|
|
||||||
@@ -1,140 +0,0 @@
|
|||||||
import dev.inmo.kslog.common.KSLog
|
|
||||||
import dev.inmo.kslog.common.LogLevel
|
|
||||||
import dev.inmo.kslog.common.defaultMessageFormatter
|
|
||||||
import dev.inmo.kslog.common.setDefaultKSLog
|
|
||||||
import dev.inmo.micro_utils.coroutines.runCatchingLogging
|
|
||||||
import dev.inmo.micro_utils.coroutines.subscribeLoggingDropExceptions
|
|
||||||
import dev.inmo.micro_utils.coroutines.subscribeSafelyWithoutExceptions
|
|
||||||
import dev.inmo.tgbotapi.extensions.api.bot.getMe
|
|
||||||
import dev.inmo.tgbotapi.extensions.api.bot.getMyStarBalance
|
|
||||||
import dev.inmo.tgbotapi.extensions.api.chat.get.getChat
|
|
||||||
import dev.inmo.tgbotapi.extensions.api.send.reply
|
|
||||||
import dev.inmo.tgbotapi.extensions.api.send.resend
|
|
||||||
import dev.inmo.tgbotapi.extensions.api.send.send
|
|
||||||
import dev.inmo.tgbotapi.extensions.api.suggested.approveSuggestedPost
|
|
||||||
import dev.inmo.tgbotapi.extensions.api.suggested.declineSuggestedPost
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextData
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.buildSubcontextInitialAction
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitSuggestedPostApproved
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitSuggestedPostDeclined
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.telegramBotWithBehaviourAndLongPolling
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onChannelDirectMessagesConfigurationChanged
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onCommand
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onContentMessage
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onSuggestedPostApprovalFailed
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onSuggestedPostApproved
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onSuggestedPostDeclined
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onSuggestedPostPaid
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onSuggestedPostRefunded
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.channelDirectMessagesContentMessageOrNull
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.previewChannelDirectMessagesChatOrNull
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.suggestedChannelDirectMessagesContentMessageOrNull
|
|
||||||
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
|
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.ChannelPaidPost
|
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage
|
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
|
||||||
import dev.inmo.tgbotapi.utils.firstOf
|
|
||||||
import kotlinx.coroutines.CoroutineScope
|
|
||||||
import kotlinx.coroutines.Dispatchers
|
|
||||||
import kotlinx.coroutines.delay
|
|
||||||
import kotlinx.coroutines.flow.filter
|
|
||||||
import kotlinx.coroutines.flow.first
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This place can be the playground for your code.
|
|
||||||
*/
|
|
||||||
suspend fun main(vararg args: String) {
|
|
||||||
val botToken = args.first()
|
|
||||||
|
|
||||||
val isDebug = args.any { it == "debug" }
|
|
||||||
val isTestServer = args.any { it == "testServer" }
|
|
||||||
|
|
||||||
if (isDebug) {
|
|
||||||
setDefaultKSLog(
|
|
||||||
KSLog { level: LogLevel, tag: String?, message: Any, throwable: Throwable? ->
|
|
||||||
println(defaultMessageFormatter(level, tag, message, throwable))
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
telegramBotWithBehaviourAndLongPolling(
|
|
||||||
botToken,
|
|
||||||
CoroutineScope(Dispatchers.Default),
|
|
||||||
testServer = isTestServer,
|
|
||||||
) {
|
|
||||||
// start here!!
|
|
||||||
val me = getMe()
|
|
||||||
println(me)
|
|
||||||
|
|
||||||
onCommand("start") {
|
|
||||||
println(getChat(it.chat))
|
|
||||||
}
|
|
||||||
|
|
||||||
onContentMessage {
|
|
||||||
val message = it.channelDirectMessagesContentMessageOrNull() ?: return@onContentMessage
|
|
||||||
val chat = getChat(it.chat)
|
|
||||||
println(chat)
|
|
||||||
|
|
||||||
resend(
|
|
||||||
message.chat.id,
|
|
||||||
message.content,
|
|
||||||
suggestedPostParameters = SuggestedPostParameters()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
onContentMessage(
|
|
||||||
subcontextUpdatesFilter = { _, _ -> true } // important to not miss updates in channel for waitSuggestedPost events
|
|
||||||
) { message ->
|
|
||||||
val suggestedPost = message.suggestedChannelDirectMessagesContentMessageOrNull() ?: return@onContentMessage
|
|
||||||
|
|
||||||
firstOf(
|
|
||||||
{
|
|
||||||
waitSuggestedPostApproved().filter {
|
|
||||||
it.suggestedPostMessage ?.chat ?.id == message.chat.id
|
|
||||||
}.first()
|
|
||||||
},
|
|
||||||
{
|
|
||||||
waitSuggestedPostDeclined().filter {
|
|
||||||
it.suggestedPostMessage ?.chat ?.id == message.chat.id
|
|
||||||
}.first()
|
|
||||||
},
|
|
||||||
{
|
|
||||||
for (i in 0 until 3) {
|
|
||||||
delay(1000L)
|
|
||||||
send(suggestedPost.chat, "${3 - i}")
|
|
||||||
}
|
|
||||||
declineSuggestedPost(suggestedPost)
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
onContentMessage(initialFilter = { it is ChannelPaidPost<*> }) {
|
|
||||||
println(it)
|
|
||||||
}
|
|
||||||
|
|
||||||
onSuggestedPostPaid {
|
|
||||||
println(it)
|
|
||||||
reply(it, "Paid")
|
|
||||||
}
|
|
||||||
onSuggestedPostApproved {
|
|
||||||
println(it)
|
|
||||||
reply(it, "Approved")
|
|
||||||
}
|
|
||||||
onSuggestedPostDeclined {
|
|
||||||
println(it)
|
|
||||||
reply(it, "Declined")
|
|
||||||
}
|
|
||||||
onSuggestedPostRefunded {
|
|
||||||
println(it)
|
|
||||||
reply(it, "Refunded")
|
|
||||||
}
|
|
||||||
onSuggestedPostApprovalFailed {
|
|
||||||
println(it)
|
|
||||||
reply(it, "Approval failed")
|
|
||||||
}
|
|
||||||
|
|
||||||
allUpdatesFlow.subscribeLoggingDropExceptions(this) {
|
|
||||||
println(it)
|
|
||||||
}
|
|
||||||
}.second.join()
|
|
||||||
}
|
|
||||||
@@ -5,9 +5,9 @@ org.gradle.jvmargs=-Xmx3148m
|
|||||||
kotlin.daemon.jvmargs=-Xmx3g -Xms500m
|
kotlin.daemon.jvmargs=-Xmx3g -Xms500m
|
||||||
|
|
||||||
|
|
||||||
kotlin_version=2.2.10
|
kotlin_version=2.2.0
|
||||||
telegram_bot_api_version=29.0.0
|
telegram_bot_api_version=28.0.0-branch_28.0.0-build2910
|
||||||
micro_utils_version=0.26.3
|
micro_utils_version=0.26.1
|
||||||
serialization_version=1.9.0
|
serialization_version=1.9.0
|
||||||
ktor_version=3.2.3
|
ktor_version=3.2.3
|
||||||
compose_version=1.8.2
|
compose_version=1.8.2
|
||||||
|
|||||||
@@ -59,7 +59,3 @@ include ":CustomBot"
|
|||||||
include ":MemberUpdatedWatcherBot"
|
include ":MemberUpdatedWatcherBot"
|
||||||
|
|
||||||
include ":WebHooks"
|
include ":WebHooks"
|
||||||
|
|
||||||
include ":SuggestedPosts"
|
|
||||||
|
|
||||||
include ":ChecklistsBot"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user