1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 16:23:48 +00:00

add defaults to setMessageReaction

This commit is contained in:
InsanusMokrassar 2024-01-08 18:56:21 +06:00
parent f2308f0312
commit f0448485c8

View File

@ -14,7 +14,7 @@ import kotlin.jvm.JvmName
suspend fun TelegramBot.setMessageReactions( suspend fun TelegramBot.setMessageReactions(
chatId: ChatIdentifier, chatId: ChatIdentifier,
messageId: MessageId, messageId: MessageId,
reactions: List<Reaction>, reactions: List<Reaction> = emptyList(),
big: Boolean = false big: Boolean = false
) = execute( ) = execute(
SetMessageReactions(chatId, messageId, reactions, big) SetMessageReactions(chatId, messageId, reactions, big)
@ -23,45 +23,45 @@ suspend fun TelegramBot.setMessageReactions(
suspend fun TelegramBot.setMessageReaction( suspend fun TelegramBot.setMessageReaction(
chatId: ChatIdentifier, chatId: ChatIdentifier,
messageId: MessageId, messageId: MessageId,
reaction: Reaction?, reaction: Reaction? = null,
big: Boolean = false big: Boolean = false
) = setMessageReactions(chatId, messageId, listOfNotNull(reaction), big) ) = setMessageReactions(chatId, messageId, listOfNotNull(reaction), big)
suspend fun TelegramBot.setMessageReactions( suspend fun TelegramBot.setMessageReactions(
chat: Chat, chat: Chat,
messageId: MessageId, messageId: MessageId,
reactions: List<Reaction>, reactions: List<Reaction> = emptyList(),
big: Boolean = false big: Boolean = false
) = setMessageReactions(chat.id, messageId, reactions, big) ) = setMessageReactions(chat.id, messageId, reactions, big)
suspend fun TelegramBot.setMessageReaction( suspend fun TelegramBot.setMessageReaction(
chat: Chat, chat: Chat,
messageId: MessageId, messageId: MessageId,
reaction: Reaction?, reaction: Reaction? = null,
big: Boolean = false big: Boolean = false
) = setMessageReaction(chat.id, messageId, reaction, big) ) = setMessageReaction(chat.id, messageId, reaction, big)
suspend fun TelegramBot.setMessageReactions( suspend fun TelegramBot.setMessageReactions(
meta: Message.MetaInfo, meta: Message.MetaInfo,
reactions: List<Reaction>, reactions: List<Reaction> = emptyList(),
big: Boolean = false big: Boolean = false
) = setMessageReactions(meta.chatId, meta.messageId, reactions, big) ) = setMessageReactions(meta.chatId, meta.messageId, reactions, big)
suspend fun TelegramBot.setMessageReaction( suspend fun TelegramBot.setMessageReaction(
meta: Message.MetaInfo, meta: Message.MetaInfo,
reaction: Reaction?, reaction: Reaction? = null,
big: Boolean = false big: Boolean = false
) = setMessageReaction(meta.chatId, meta.messageId, reaction, big) ) = setMessageReaction(meta.chatId, meta.messageId, reaction, big)
suspend fun TelegramBot.setMessageReactions( suspend fun TelegramBot.setMessageReactions(
message: AccessibleMessage, message: AccessibleMessage,
reactions: List<Reaction>, reactions: List<Reaction> = emptyList(),
big: Boolean = false big: Boolean = false
) = setMessageReactions(message.metaInfo, reactions, big) ) = setMessageReactions(message.metaInfo, reactions, big)
suspend fun TelegramBot.setMessageReaction( suspend fun TelegramBot.setMessageReaction(
message: AccessibleMessage, message: AccessibleMessage,
reaction: Reaction?, reaction: Reaction? = null,
big: Boolean = false big: Boolean = false
) = setMessageReaction(message.metaInfo, reaction, big) ) = setMessageReaction(message.metaInfo, reaction, big)
@ -69,54 +69,54 @@ suspend fun TelegramBot.setMessageReaction(
suspend fun TelegramBot.setMessageReactions( suspend fun TelegramBot.setMessageReactions(
chatId: ChatIdentifier, chatId: ChatIdentifier,
messageId: MessageId, messageId: MessageId,
reactions: List<String>, emojis: List<String>,
big: Boolean = false big: Boolean = false
) = setMessageReactions(chatId, messageId, reactions.map { Reaction.Emoji(it) }, big) ) = setMessageReactions(chatId, messageId, emojis.map { Reaction.Emoji(it) }, big)
suspend fun TelegramBot.setMessageReaction( suspend fun TelegramBot.setMessageReaction(
chatId: ChatIdentifier, chatId: ChatIdentifier,
messageId: MessageId, messageId: MessageId,
reaction: String?, emoji: String?,
big: Boolean = false big: Boolean = false
) = setMessageReaction(chatId, messageId, reaction ?.let { Reaction.Emoji(it) }, big) ) = setMessageReaction(chatId, messageId, emoji ?.let { Reaction.Emoji(it) }, big)
@JvmName("setMessageReactionsStrings") @JvmName("setMessageReactionsStrings")
suspend fun TelegramBot.setMessageReactions( suspend fun TelegramBot.setMessageReactions(
chat: Chat, chat: Chat,
messageId: MessageId, messageId: MessageId,
reactions: List<String>, emojis: List<String>,
big: Boolean = false big: Boolean = false
) = setMessageReactions(chat, messageId, reactions.map { Reaction.Emoji(it) }, big) ) = setMessageReactions(chat, messageId, emojis.map { Reaction.Emoji(it) }, big)
suspend fun TelegramBot.setMessageReaction( suspend fun TelegramBot.setMessageReaction(
chat: Chat, chat: Chat,
messageId: MessageId, messageId: MessageId,
reaction: String?, emoji: String?,
big: Boolean = false big: Boolean = false
) = setMessageReaction(chat, messageId, reaction ?.let { Reaction.Emoji(it) }, big) ) = setMessageReaction(chat, messageId, emoji ?.let { Reaction.Emoji(it) }, big)
@JvmName("setMessageReactionsStrings") @JvmName("setMessageReactionsStrings")
suspend fun TelegramBot.setMessageReactions( suspend fun TelegramBot.setMessageReactions(
meta: Message.MetaInfo, meta: Message.MetaInfo,
reactions: List<String>, emojis: List<String>,
big: Boolean = false big: Boolean = false
) = setMessageReactions(meta, reactions.map { Reaction.Emoji(it) }, big) ) = setMessageReactions(meta, emojis.map { Reaction.Emoji(it) }, big)
suspend fun TelegramBot.setMessageReaction( suspend fun TelegramBot.setMessageReaction(
meta: Message.MetaInfo, meta: Message.MetaInfo,
reaction: String?, emoji: String?,
big: Boolean = false big: Boolean = false
) = setMessageReaction(meta, reaction ?.let { Reaction.Emoji(it) }, big) ) = setMessageReaction(meta, emoji ?.let { Reaction.Emoji(it) }, big)
@JvmName("setMessageReactionsStrings") @JvmName("setMessageReactionsStrings")
suspend fun TelegramBot.setMessageReactions( suspend fun TelegramBot.setMessageReactions(
message: AccessibleMessage, message: AccessibleMessage,
reactions: List<String>, emojis: List<String>,
big: Boolean = false big: Boolean = false
) = setMessageReactions(message, reactions.map { Reaction.Emoji(it) }, big) ) = setMessageReactions(message, emojis.map { Reaction.Emoji(it) }, big)
suspend fun TelegramBot.setMessageReaction( suspend fun TelegramBot.setMessageReaction(
message: AccessibleMessage, message: AccessibleMessage,
reaction: String?, emoji: String?,
big: Boolean = false big: Boolean = false
) = setMessageReaction(message, reaction ?.let { Reaction.Emoji(it) }, big) ) = setMessageReaction(message, emoji ?.let { Reaction.Emoji(it) }, big)