All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.dehuckakpyt.telegrambot.source.message.DatabaseMessageSource.kt Maven / Gradle / Ivy

The newest version!
package io.github.dehuckakpyt.telegrambot.source.message

import io.github.dehuckakpyt.telegrambot.ext.transaction.executeQuery
import io.github.dehuckakpyt.telegrambot.model.DatabaseTelegramMessage
import io.github.dehuckakpyt.telegrambot.model.telegram.Message

class DatabaseMessageSource : MessageSource {

    override suspend fun save(message: Message, fromBot: Boolean, type: String, step: String?, stepContainerType: String?, text: String?, fileIds: List?): Unit = executeQuery {
        DatabaseTelegramMessage.new {
            this.chatId = message.chat.id
            this.fromId = message.from!!.id
            this.fromBot = fromBot
            this.messageId = message.messageId
            this.type = type
            this.step = step
            this.stepContainerType = stepContainerType
            this.text = text
            this.fileIds = fileIds
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy