1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-09-16 05:40:32 +00:00
This commit is contained in:
2018-12-26 16:07:24 +08:00
parent 120db4c445
commit 89eda29965
330 changed files with 6934 additions and 3 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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())

View File

@@ -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()
}