1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-25 19:48:43 +00:00

update setMessageReaction

This commit is contained in:
InsanusMokrassar 2024-01-08 18:49:04 +06:00
parent d480c9efd6
commit f2308f0312

View File

@ -6,7 +6,10 @@ import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.MessageId
import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
import dev.inmo.tgbotapi.types.message.abstracts.Message
import dev.inmo.tgbotapi.types.reactions.Reaction
import kotlin.js.JsName
import kotlin.jvm.JvmName
suspend fun TelegramBot.setMessageReactions(
chatId: ChatIdentifier,
@ -38,14 +41,82 @@ suspend fun TelegramBot.setMessageReaction(
big: Boolean = false
) = setMessageReaction(chat.id, messageId, reaction, big)
suspend fun TelegramBot.setMessageReactions(
meta: Message.MetaInfo,
reactions: List<Reaction>,
big: Boolean = false
) = setMessageReactions(meta.chatId, meta.messageId, reactions, big)
suspend fun TelegramBot.setMessageReaction(
meta: Message.MetaInfo,
reaction: Reaction?,
big: Boolean = false
) = setMessageReaction(meta.chatId, meta.messageId, reaction, big)
suspend fun TelegramBot.setMessageReactions(
message: AccessibleMessage,
reactions: List<Reaction>,
big: Boolean = false
) = setMessageReactions(message.chat, message.messageId, reactions, big)
) = setMessageReactions(message.metaInfo, reactions, big)
suspend fun TelegramBot.setMessageReaction(
message: AccessibleMessage,
reaction: Reaction?,
big: Boolean = false
) = setMessageReaction(message.chat, message.messageId, reaction, big)
) = setMessageReaction(message.metaInfo, reaction, big)
@JvmName("setMessageReactionsStrings")
suspend fun TelegramBot.setMessageReactions(
chatId: ChatIdentifier,
messageId: MessageId,
reactions: List<String>,
big: Boolean = false
) = setMessageReactions(chatId, messageId, reactions.map { Reaction.Emoji(it) }, big)
suspend fun TelegramBot.setMessageReaction(
chatId: ChatIdentifier,
messageId: MessageId,
reaction: String?,
big: Boolean = false
) = setMessageReaction(chatId, messageId, reaction ?.let { Reaction.Emoji(it) }, big)
@JvmName("setMessageReactionsStrings")
suspend fun TelegramBot.setMessageReactions(
chat: Chat,
messageId: MessageId,
reactions: List<String>,
big: Boolean = false
) = setMessageReactions(chat, messageId, reactions.map { Reaction.Emoji(it) }, big)
suspend fun TelegramBot.setMessageReaction(
chat: Chat,
messageId: MessageId,
reaction: String?,
big: Boolean = false
) = setMessageReaction(chat, messageId, reaction ?.let { Reaction.Emoji(it) }, big)
@JvmName("setMessageReactionsStrings")
suspend fun TelegramBot.setMessageReactions(
meta: Message.MetaInfo,
reactions: List<String>,
big: Boolean = false
) = setMessageReactions(meta, reactions.map { Reaction.Emoji(it) }, big)
suspend fun TelegramBot.setMessageReaction(
meta: Message.MetaInfo,
reaction: String?,
big: Boolean = false
) = setMessageReaction(meta, reaction ?.let { Reaction.Emoji(it) }, big)
@JvmName("setMessageReactionsStrings")
suspend fun TelegramBot.setMessageReactions(
message: AccessibleMessage,
reactions: List<String>,
big: Boolean = false
) = setMessageReactions(message, reactions.map { Reaction.Emoji(it) }, big)
suspend fun TelegramBot.setMessageReaction(
message: AccessibleMessage,
reaction: String?,
big: Boolean = false
) = setMessageReaction(message, reaction ?.let { Reaction.Emoji(it) }, big)