mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-09-16 05:40:32 +00:00
init
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.requests.games
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ByMessageId
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.games.abstracts.GetGameHighScores
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class GetGameHighScoresByChat (
|
||||
@SerialName(userIdField)
|
||||
override val userId: UserId,
|
||||
@SerialName(chatIdField)
|
||||
override val chatId: ChatId,
|
||||
@SerialName(messageIdField)
|
||||
override val messageId: MessageIdentifier
|
||||
) : GetGameHighScores, ByMessageId
|
@@ -0,0 +1,15 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.requests.games
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ByInlineMessageId
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.games.abstracts.GetGameHighScores
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class GetGameHighScoresByInlineMessageId (
|
||||
@SerialName(userIdField)
|
||||
override val userId: UserId,
|
||||
@SerialName(inlineMessageIdField)
|
||||
override val inlineMessageId: InlineMessageIdentifier
|
||||
) : GetGameHighScores, ByInlineMessageId
|
@@ -0,0 +1,24 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.requests.games
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ByMessageId
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.games.abstracts.SetGameScore
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||
import kotlinx.serialization.*
|
||||
|
||||
@Serializable
|
||||
data class SetGameScoreByChatId (
|
||||
@SerialName(userIdField)
|
||||
override val userId: UserId,
|
||||
@SerialName(scoreField)
|
||||
override val score: Long,
|
||||
@SerialName(chatIdField)
|
||||
override val chatId: ChatId,
|
||||
@SerialName(messageIdField)
|
||||
override val messageId: MessageIdentifier,
|
||||
@SerialName(forceField)
|
||||
@Optional
|
||||
override val force: Boolean = false,
|
||||
@SerialName(disableEditMessageField)
|
||||
@Optional
|
||||
override val disableEditMessage: Boolean = false
|
||||
) : SetGameScore, ByMessageId
|
@@ -0,0 +1,22 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.requests.games
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.types.ByInlineMessageId
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.games.abstracts.SetGameScore
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||
import kotlinx.serialization.*
|
||||
|
||||
@Serializable
|
||||
data class SetGameScoreByInlineMessageId (
|
||||
@SerialName(userIdField)
|
||||
override val userId: UserId,
|
||||
@SerialName(scoreField)
|
||||
override val score: Long,
|
||||
@SerialName(inlineMessageIdField)
|
||||
override val inlineMessageId: InlineMessageIdentifier,
|
||||
@SerialName(forceField)
|
||||
@Optional
|
||||
override val force: Boolean = false,
|
||||
@SerialName(disableEditMessageField)
|
||||
@Optional
|
||||
override val disableEditMessage: Boolean = false
|
||||
) : SetGameScore, ByInlineMessageId
|
@@ -0,0 +1,16 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.requests.games.abstracts
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.UserId
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.games.GameHighScore
|
||||
import kotlinx.serialization.KSerializer
|
||||
import kotlinx.serialization.internal.ArrayListSerializer
|
||||
|
||||
interface GetGameHighScores : SimpleRequest<List<GameHighScore>> {
|
||||
val userId: UserId
|
||||
|
||||
override fun method(): String = "getGameHighScores"
|
||||
override fun resultSerializer(): KSerializer<List<GameHighScore>> = GameHighScoresSerializer
|
||||
}
|
||||
|
||||
object GameHighScoresSerializer : KSerializer<List<GameHighScore>> by ArrayListSerializer(GameHighScore.serializer())
|
@@ -0,0 +1,16 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.requests.games.abstracts
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.UserId
|
||||
import kotlinx.serialization.KSerializer
|
||||
import kotlinx.serialization.serializer
|
||||
|
||||
interface SetGameScore : SimpleRequest<Boolean> {
|
||||
val userId: UserId
|
||||
val score: Long
|
||||
val force: Boolean
|
||||
val disableEditMessage: Boolean
|
||||
|
||||
override fun method(): String = "setGameScore"
|
||||
override fun resultSerializer(): KSerializer<Boolean> = Boolean.serializer()
|
||||
}
|
Reference in New Issue
Block a user