2018-12-26 08:07:24 +00:00
|
|
|
package com.github.insanusmokrassar.TelegramBotAPI.requests.send
|
|
|
|
|
2019-01-17 02:43:51 +00:00
|
|
|
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.SendChatMessageRequest
|
2018-12-26 08:07:24 +00:00
|
|
|
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
2020-03-22 10:04:11 +00:00
|
|
|
import com.github.insanusmokrassar.TelegramBotAPI.types.actions.BotAction
|
2018-12-26 08:07:24 +00:00
|
|
|
import kotlinx.serialization.*
|
2020-03-22 07:37:01 +00:00
|
|
|
import kotlinx.serialization.builtins.serializer
|
2018-12-26 08:07:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Send notification to user which will be shown for 5 seconds or while user have no messages from bot
|
|
|
|
*/
|
|
|
|
@Serializable
|
|
|
|
data class SendAction(
|
|
|
|
@SerialName(chatIdField)
|
|
|
|
override val chatId: ChatIdentifier,
|
|
|
|
@SerialName(actionField)
|
|
|
|
val action: BotAction
|
|
|
|
): SendChatMessageRequest<Boolean> {
|
|
|
|
override fun method(): String = "sendChatAction"
|
2019-12-02 08:35:37 +00:00
|
|
|
override val resultDeserializer: DeserializationStrategy<Boolean>
|
2020-03-22 07:37:01 +00:00
|
|
|
get() = Boolean.serializer()
|
2019-12-02 08:35:37 +00:00
|
|
|
override val requestSerializer: SerializationStrategy<*>
|
|
|
|
get() = serializer()
|
2018-12-26 08:07:24 +00:00
|
|
|
}
|