mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-09-05 08:09:21 +00:00
add new type of chats ids
This commit is contained in:
@@ -166,7 +166,7 @@ suspend fun TelegramBot.startLiveLocation(
|
||||
*/
|
||||
suspend fun TelegramBot.startLiveLocation(
|
||||
scope: CoroutineScope,
|
||||
chatId: ChatId,
|
||||
chatId: IdChatIdentifier,
|
||||
location: StaticLocation,
|
||||
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
||||
initHorizontalAccuracy: Meters? = null,
|
||||
|
@@ -34,7 +34,7 @@ suspend fun TelegramBot.stopPoll(
|
||||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.stopPoll(
|
||||
chatId: ChatId,
|
||||
chatId: IdChatIdentifier,
|
||||
message: Message,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = stopPoll(chatId, message.messageId, replyMarkup)
|
||||
|
@@ -2,11 +2,11 @@ package dev.inmo.tgbotapi.extensions.api.chat.get
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.get.GetChatMenuButton
|
||||
import dev.inmo.tgbotapi.types.ChatId
|
||||
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.chat.PrivateChat
|
||||
|
||||
suspend fun TelegramBot.getChatMenuButton(
|
||||
chatId: ChatId
|
||||
chatId: IdChatIdentifier
|
||||
) = execute(GetChatMenuButton(chatId))
|
||||
|
||||
suspend fun TelegramBot.getChatMenuButton(
|
||||
|
@@ -2,7 +2,7 @@ package dev.inmo.tgbotapi.extensions.api.chat.members
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.members.BanChatMember
|
||||
import dev.inmo.tgbotapi.types.ChatId
|
||||
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.TelegramDate
|
||||
import dev.inmo.tgbotapi.types.UserId
|
||||
@@ -24,7 +24,7 @@ suspend fun TelegramBot.banChatMember(
|
||||
) = banChatMember(chat.id, userId, untilDate, revokeMessages)
|
||||
|
||||
suspend fun TelegramBot.banChatMember(
|
||||
chatId: ChatId,
|
||||
chatId: IdChatIdentifier,
|
||||
user: User,
|
||||
untilDate: TelegramDate? = null,
|
||||
revokeMessages: Boolean? = null
|
||||
|
@@ -2,22 +2,22 @@ package dev.inmo.tgbotapi.extensions.api.chat.members
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.members.BanChatSenderChat
|
||||
import dev.inmo.tgbotapi.types.ChatId
|
||||
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||
|
||||
suspend fun TelegramBot.banChatSenderChat(
|
||||
chatId: ChatIdentifier,
|
||||
senderChatId: ChatId
|
||||
senderChatId: IdChatIdentifier
|
||||
) = execute(BanChatSenderChat(chatId, senderChatId))
|
||||
|
||||
suspend fun TelegramBot.banChatSenderChat(
|
||||
chat: PublicChat,
|
||||
senderChatId: ChatId
|
||||
senderChatId: IdChatIdentifier
|
||||
) = banChatSenderChat(chat.id, senderChatId)
|
||||
|
||||
suspend fun TelegramBot.banChatSenderChat(
|
||||
chatId: ChatId,
|
||||
chatId: IdChatIdentifier,
|
||||
senderChat: PublicChat
|
||||
) = banChatSenderChat(chatId, senderChat.id)
|
||||
|
||||
|
@@ -2,7 +2,7 @@ package dev.inmo.tgbotapi.extensions.api.chat.members
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.members.GetChatMember
|
||||
import dev.inmo.tgbotapi.types.ChatId
|
||||
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.UserId
|
||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||
@@ -19,7 +19,7 @@ suspend fun TelegramBot.getChatMember(
|
||||
) = getChatMember(chat.id, userId)
|
||||
|
||||
suspend fun TelegramBot.getChatMember(
|
||||
chatId: ChatId,
|
||||
chatId: IdChatIdentifier,
|
||||
user: User
|
||||
) = getChatMember(chatId, user.id)
|
||||
|
||||
|
@@ -2,7 +2,7 @@ package dev.inmo.tgbotapi.extensions.api.chat.members
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.members.PromoteChatMember
|
||||
import dev.inmo.tgbotapi.types.ChatId
|
||||
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.TelegramDate
|
||||
import dev.inmo.tgbotapi.types.UserId
|
||||
@@ -80,7 +80,7 @@ suspend fun TelegramBot.promoteChatMember(
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.promoteChatMember(
|
||||
chatId: ChatId,
|
||||
chatId: IdChatIdentifier,
|
||||
user: User,
|
||||
untilDate: TelegramDate? = null,
|
||||
isAnonymous: Boolean? = null,
|
||||
|
@@ -2,7 +2,7 @@ package dev.inmo.tgbotapi.extensions.api.chat.members
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.members.RestrictChatMember
|
||||
import dev.inmo.tgbotapi.types.ChatId
|
||||
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.TelegramDate
|
||||
import dev.inmo.tgbotapi.types.UserId
|
||||
@@ -25,7 +25,7 @@ suspend fun TelegramBot.restrictChatMember(
|
||||
) = restrictChatMember(chat.id, userId, untilDate, permissions)
|
||||
|
||||
suspend fun TelegramBot.restrictChatMember(
|
||||
chatId: ChatId,
|
||||
chatId: IdChatIdentifier,
|
||||
user: User,
|
||||
untilDate: TelegramDate? = null,
|
||||
permissions: ChatPermissions = ChatPermissions()
|
||||
|
@@ -2,13 +2,13 @@ package dev.inmo.tgbotapi.extensions.api.chat.members
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.members.SetChatAdministratorCustomTitle
|
||||
import dev.inmo.tgbotapi.types.ChatId
|
||||
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.UserId
|
||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||
import dev.inmo.tgbotapi.types.chat.User
|
||||
|
||||
suspend fun TelegramBot.setChatAdministratorCustomTitle(
|
||||
chatId: ChatId,
|
||||
chatId: IdChatIdentifier,
|
||||
userId: UserId,
|
||||
customTitle: String
|
||||
) = execute(SetChatAdministratorCustomTitle(chatId, userId, customTitle))
|
||||
@@ -20,7 +20,7 @@ suspend fun TelegramBot.setChatAdministratorCustomTitle(
|
||||
) = setChatAdministratorCustomTitle(chat.id, userId, customTitle)
|
||||
|
||||
suspend fun TelegramBot.setChatAdministratorCustomTitle(
|
||||
chatId: ChatId,
|
||||
chatId: IdChatIdentifier,
|
||||
user: User,
|
||||
customTitle: String
|
||||
) = setChatAdministratorCustomTitle(chatId, user.id, customTitle)
|
||||
|
@@ -2,7 +2,7 @@ package dev.inmo.tgbotapi.extensions.api.chat.members
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.members.UnbanChatMember
|
||||
import dev.inmo.tgbotapi.types.ChatId
|
||||
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.UserId
|
||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||
@@ -21,7 +21,7 @@ suspend fun TelegramBot.unbanChatMember(
|
||||
) = unbanChatMember(chat.id, userId, onlyIfBanned)
|
||||
|
||||
suspend fun TelegramBot.unbanChatMember(
|
||||
chatId: ChatId,
|
||||
chatId: IdChatIdentifier,
|
||||
user: User,
|
||||
onlyIfBanned: Boolean? = null
|
||||
) = unbanChatMember(chatId, user.id, onlyIfBanned)
|
||||
|
@@ -2,22 +2,22 @@ package dev.inmo.tgbotapi.extensions.api.chat.members
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.members.UnbanChatSenderChat
|
||||
import dev.inmo.tgbotapi.types.ChatId
|
||||
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||
|
||||
suspend fun TelegramBot.unbanChatSenderChat(
|
||||
chatId: ChatIdentifier,
|
||||
senderChatId: ChatId
|
||||
senderChatId: IdChatIdentifier
|
||||
) = execute(UnbanChatSenderChat(chatId, senderChatId))
|
||||
|
||||
suspend fun TelegramBot.unbanChatSenderChat(
|
||||
chat: PublicChat,
|
||||
senderChatId: ChatId
|
||||
senderChatId: IdChatIdentifier
|
||||
) = unbanChatSenderChat(chat.id, senderChatId)
|
||||
|
||||
suspend fun TelegramBot.unbanChatSenderChat(
|
||||
chatId: ChatId,
|
||||
chatId: IdChatIdentifier,
|
||||
senderChat: PublicChat
|
||||
) = unbanChatSenderChat(chatId, senderChat.id)
|
||||
|
||||
|
@@ -2,12 +2,12 @@ package dev.inmo.tgbotapi.extensions.api.chat.modify
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.modify.SetChatMenuButton
|
||||
import dev.inmo.tgbotapi.types.ChatId
|
||||
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.MenuButton
|
||||
import dev.inmo.tgbotapi.types.chat.PrivateChat
|
||||
|
||||
suspend fun TelegramBot.setChatMenuButton(
|
||||
chatId: ChatId,
|
||||
chatId: IdChatIdentifier,
|
||||
menuButton: MenuButton
|
||||
) = execute(SetChatMenuButton(chatId, menuButton))
|
||||
|
||||
|
@@ -10,7 +10,7 @@ import dev.inmo.tgbotapi.types.message.content.GameContent
|
||||
|
||||
suspend fun TelegramBot.getGameScore(
|
||||
userId: UserId,
|
||||
chatId: ChatId,
|
||||
chatId: IdChatIdentifier,
|
||||
messageId: MessageId
|
||||
) = execute(
|
||||
GetGameHighScoresByChat(userId, chatId, messageId)
|
||||
@@ -18,7 +18,7 @@ suspend fun TelegramBot.getGameScore(
|
||||
|
||||
suspend fun TelegramBot.getGameScore(
|
||||
user: CommonUser,
|
||||
chatId: ChatId,
|
||||
chatId: IdChatIdentifier,
|
||||
messageId: MessageId
|
||||
) = getGameScore(
|
||||
user.id, chatId, messageId
|
||||
|
@@ -11,7 +11,7 @@ import dev.inmo.tgbotapi.types.message.content.GameContent
|
||||
suspend fun TelegramBot.setGameScore(
|
||||
userId: UserId,
|
||||
score: Long,
|
||||
chatId: ChatId,
|
||||
chatId: IdChatIdentifier,
|
||||
messageId: MessageId,
|
||||
force: Boolean = false,
|
||||
disableEditMessage: Boolean = false
|
||||
@@ -22,7 +22,7 @@ suspend fun TelegramBot.setGameScore(
|
||||
suspend fun TelegramBot.setGameScore(
|
||||
user: CommonUser,
|
||||
score: Long,
|
||||
chatId: ChatId,
|
||||
chatId: IdChatIdentifier,
|
||||
messageId: MessageId,
|
||||
force: Boolean = false,
|
||||
disableEditMessage: Boolean = false
|
||||
|
@@ -42,7 +42,7 @@ import kotlin.jvm.JvmName
|
||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||
*/
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
phoneNumber: String,
|
||||
firstName: String,
|
||||
@@ -70,7 +70,7 @@ suspend inline fun TelegramBot.reply(
|
||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||
*/
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
contact: Contact,
|
||||
threadId: MessageThreadId? = null,
|
||||
@@ -97,7 +97,7 @@ suspend inline fun TelegramBot.reply(
|
||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||
*/
|
||||
suspend inline fun TelegramBot.replyWithDice(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
animationType: DiceAnimationType? = null,
|
||||
threadId: MessageThreadId? = null,
|
||||
@@ -112,7 +112,7 @@ suspend inline fun TelegramBot.replyWithDice(
|
||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||
*/
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
animationType: DiceAnimationType,
|
||||
threadId: MessageThreadId? = null,
|
||||
@@ -130,7 +130,7 @@ suspend inline fun TelegramBot.reply(
|
||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||
*/
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
@@ -156,7 +156,7 @@ suspend inline fun TelegramBot.reply(
|
||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||
*/
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
location: StaticLocation,
|
||||
threadId: MessageThreadId? = null,
|
||||
@@ -183,7 +183,7 @@ suspend inline fun TelegramBot.reply(
|
||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||
*/
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
@@ -211,7 +211,7 @@ suspend inline fun TelegramBot.reply(
|
||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||
*/
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
entities: TextSourcesList,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
@@ -237,7 +237,7 @@ suspend inline fun TelegramBot.reply(
|
||||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
separator: TextSource? = null,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
@@ -254,7 +254,7 @@ suspend fun TelegramBot.reply(
|
||||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
separator: String,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
@@ -274,7 +274,7 @@ suspend fun TelegramBot.reply(
|
||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||
*/
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
@@ -308,7 +308,7 @@ suspend inline fun TelegramBot.reply(
|
||||
)
|
||||
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
location: StaticLocation,
|
||||
title: String,
|
||||
@@ -341,7 +341,7 @@ suspend inline fun TelegramBot.reply(
|
||||
)
|
||||
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
venue: Venue,
|
||||
threadId: MessageThreadId? = null,
|
||||
@@ -364,7 +364,7 @@ suspend inline fun TelegramBot.reply(
|
||||
// Game
|
||||
|
||||
suspend inline fun TelegramBot.replyWithGame(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
gameShortName: String,
|
||||
threadId: MessageThreadId? = null,
|
||||
@@ -377,7 +377,7 @@ suspend inline fun TelegramBot.replyWithGame(
|
||||
)
|
||||
|
||||
suspend inline fun TelegramBot.replyWithGame(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
game: Game,
|
||||
threadId: MessageThreadId? = null,
|
||||
@@ -390,7 +390,7 @@ suspend inline fun TelegramBot.replyWithGame(
|
||||
)
|
||||
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
game: Game,
|
||||
threadId: MessageThreadId? = null,
|
||||
@@ -404,7 +404,7 @@ suspend inline fun TelegramBot.reply(
|
||||
// Animation
|
||||
|
||||
suspend inline fun TelegramBot.replyWithAnimation(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
animation: InputFile,
|
||||
thumb: InputFile? = null,
|
||||
@@ -436,7 +436,7 @@ suspend inline fun TelegramBot.replyWithAnimation(
|
||||
)
|
||||
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
animation: AnimationFile,
|
||||
text: String? = null,
|
||||
@@ -452,7 +452,7 @@ suspend inline fun TelegramBot.reply(
|
||||
) = sendAnimation(toChatId, animation, text, parseMode, duration, width, height, threadId, disableNotification, protectContent, toMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
|
||||
suspend inline fun TelegramBot.replyWithAnimation(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
animation: InputFile,
|
||||
entities: TextSourcesList,
|
||||
@@ -482,7 +482,7 @@ suspend inline fun TelegramBot.replyWithAnimation(
|
||||
)
|
||||
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
animation: AnimationFile,
|
||||
entities: TextSourcesList,
|
||||
@@ -500,7 +500,7 @@ suspend inline fun TelegramBot.reply(
|
||||
// Audio
|
||||
|
||||
suspend inline fun TelegramBot.replyWithAudio(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
audio: InputFile,
|
||||
thumb: InputFile? = null,
|
||||
@@ -517,7 +517,7 @@ suspend inline fun TelegramBot.replyWithAudio(
|
||||
) = sendAudio(toChatId, audio, thumb, text, parseMode, duration, performer, title, threadId, disableNotification, protectContent, toMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
audio: AudioFile,
|
||||
text: String? = null,
|
||||
@@ -531,7 +531,7 @@ suspend inline fun TelegramBot.reply(
|
||||
) = sendAudio(toChatId, audio, text, parseMode, title, threadId, disableNotification, protectContent, toMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
|
||||
suspend inline fun TelegramBot.replyWithAudio(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
audio: InputFile,
|
||||
thumb: InputFile? = null,
|
||||
@@ -547,7 +547,7 @@ suspend inline fun TelegramBot.replyWithAudio(
|
||||
) = sendAudio(toChatId, audio, thumb, entities, duration, performer, title, threadId, disableNotification, protectContent, toMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
audio: AudioFile,
|
||||
entities: TextSourcesList,
|
||||
@@ -563,7 +563,7 @@ suspend inline fun TelegramBot.reply(
|
||||
// Documents
|
||||
|
||||
suspend inline fun TelegramBot.replyWithDocument(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
document: InputFile,
|
||||
thumb: InputFile? = null,
|
||||
@@ -578,7 +578,7 @@ suspend inline fun TelegramBot.replyWithDocument(
|
||||
) = sendDocument(toChatId, document, thumb, text, parseMode, threadId, disableNotification, protectContent, toMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
||||
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
document: DocumentFile,
|
||||
text: String? = null,
|
||||
@@ -592,7 +592,7 @@ suspend inline fun TelegramBot.reply(
|
||||
) = sendDocument(toChatId, document, text, parseMode, threadId, disableNotification, protectContent, toMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
||||
|
||||
suspend inline fun TelegramBot.replyWithDocument(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
document: InputFile,
|
||||
thumb: InputFile? = null,
|
||||
@@ -606,7 +606,7 @@ suspend inline fun TelegramBot.replyWithDocument(
|
||||
) = sendDocument(toChatId, document, thumb, entities, threadId, disableNotification, protectContent, toMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
||||
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
document: DocumentFile,
|
||||
entities: TextSourcesList,
|
||||
@@ -623,7 +623,7 @@ suspend inline fun TelegramBot.reply(
|
||||
|
||||
@RiskFeature(rawSendingMediaGroupsWarning)
|
||||
suspend inline fun TelegramBot.replyWithMediaGroup(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
media: List<MediaGroupMemberTelegramMedia>,
|
||||
threadId: MessageThreadId? = null,
|
||||
@@ -633,7 +633,7 @@ suspend inline fun TelegramBot.replyWithMediaGroup(
|
||||
) = sendMediaGroup(toChatId, media, threadId, disableNotification, protectContent, toMessageId, allowSendingWithoutReply)
|
||||
|
||||
suspend inline fun TelegramBot.replyWithPlaylist(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
media: List<AudioMediaGroupMemberTelegramMedia>,
|
||||
threadId: MessageThreadId? = null,
|
||||
@@ -643,7 +643,7 @@ suspend inline fun TelegramBot.replyWithPlaylist(
|
||||
) = sendPlaylist(toChatId, media, threadId, disableNotification, protectContent, toMessageId, allowSendingWithoutReply)
|
||||
|
||||
suspend inline fun TelegramBot.replyWithDocuments(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
media: List<DocumentMediaGroupMemberTelegramMedia>,
|
||||
threadId: MessageThreadId? = null,
|
||||
@@ -653,7 +653,7 @@ suspend inline fun TelegramBot.replyWithDocuments(
|
||||
) = sendDocumentsGroup(toChatId, media, threadId, disableNotification, protectContent, toMessageId, allowSendingWithoutReply)
|
||||
|
||||
suspend inline fun TelegramBot.replyWithGallery(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
media: List<VisualMediaGroupMemberTelegramMedia>,
|
||||
threadId: MessageThreadId? = null,
|
||||
@@ -666,7 +666,7 @@ suspend inline fun TelegramBot.replyWithGallery(
|
||||
// Photo
|
||||
|
||||
suspend inline fun TelegramBot.replyWithPhoto(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
fileId: InputFile,
|
||||
text: String? = null,
|
||||
@@ -679,7 +679,7 @@ suspend inline fun TelegramBot.replyWithPhoto(
|
||||
) = sendPhoto(toChatId, fileId, text, parseMode, threadId, disableNotification, protectContent, toMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
photo: Photo,
|
||||
text: String? = null,
|
||||
@@ -692,7 +692,7 @@ suspend inline fun TelegramBot.reply(
|
||||
) = sendPhoto(toChatId, photo, text, parseMode, threadId, disableNotification, protectContent, toMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
photoSize: PhotoSize,
|
||||
text: String? = null,
|
||||
@@ -706,7 +706,7 @@ suspend inline fun TelegramBot.reply(
|
||||
|
||||
|
||||
suspend inline fun TelegramBot.replyWithPhoto(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
fileId: InputFile,
|
||||
entities: TextSourcesList,
|
||||
@@ -718,7 +718,7 @@ suspend inline fun TelegramBot.replyWithPhoto(
|
||||
) = sendPhoto(toChatId, fileId, entities, threadId, disableNotification, protectContent, toMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
photo: Photo,
|
||||
entities: TextSourcesList,
|
||||
@@ -730,7 +730,7 @@ suspend inline fun TelegramBot.reply(
|
||||
) = sendPhoto(toChatId, photo, entities, threadId, disableNotification, protectContent, toMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
photoSize: PhotoSize,
|
||||
entities: TextSourcesList,
|
||||
@@ -745,7 +745,7 @@ suspend inline fun TelegramBot.reply(
|
||||
// Sticker
|
||||
|
||||
suspend inline fun TelegramBot.replyWithSticker(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
sticker: InputFile,
|
||||
threadId: MessageThreadId? = null,
|
||||
@@ -756,7 +756,7 @@ suspend inline fun TelegramBot.replyWithSticker(
|
||||
) = sendSticker(toChatId, sticker, threadId, disableNotification, protectContent, toMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
sticker: Sticker,
|
||||
threadId: MessageThreadId? = null,
|
||||
@@ -770,7 +770,7 @@ suspend inline fun TelegramBot.reply(
|
||||
// Videos
|
||||
|
||||
suspend inline fun TelegramBot.replyWithVideo(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
video: InputFile,
|
||||
thumb: InputFile? = null,
|
||||
@@ -787,7 +787,7 @@ suspend inline fun TelegramBot.replyWithVideo(
|
||||
) = sendVideo(toChatId, video, thumb, text, parseMode, duration, width, height, threadId, disableNotification, protectContent, toMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
video: VideoFile,
|
||||
text: String? = null,
|
||||
@@ -800,7 +800,7 @@ suspend inline fun TelegramBot.reply(
|
||||
) = sendVideo(toChatId, video, text, parseMode, threadId, disableNotification, protectContent, toMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
|
||||
suspend inline fun TelegramBot.replyWithVideo(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
video: InputFile,
|
||||
thumb: InputFile? = null,
|
||||
@@ -816,7 +816,7 @@ suspend inline fun TelegramBot.replyWithVideo(
|
||||
) = sendVideo(toChatId, video, thumb, entities, duration, width, height, threadId, disableNotification, protectContent, toMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
video: VideoFile,
|
||||
entities: TextSourcesList,
|
||||
@@ -831,7 +831,7 @@ suspend inline fun TelegramBot.reply(
|
||||
// VideoNotes
|
||||
|
||||
suspend inline fun TelegramBot.replyWithVideoNote(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
videoNote: InputFile,
|
||||
thumb: InputFile? = null,
|
||||
@@ -845,7 +845,7 @@ suspend inline fun TelegramBot.replyWithVideoNote(
|
||||
) = sendVideoNote(toChatId, videoNote, thumb, duration, size, threadId, disableNotification, protectContent, toMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
videoNote: VideoNoteFile,
|
||||
threadId: MessageThreadId? = null,
|
||||
@@ -859,7 +859,7 @@ suspend inline fun TelegramBot.reply(
|
||||
// Voice
|
||||
|
||||
suspend inline fun TelegramBot.replyWithVoice(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
voice: InputFile,
|
||||
text: String? = null,
|
||||
@@ -873,7 +873,7 @@ suspend inline fun TelegramBot.replyWithVoice(
|
||||
) = sendVoice(toChatId, voice, text, parseMode, duration, threadId, disableNotification, protectContent, toMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
voice: VoiceFile,
|
||||
text: String? = null,
|
||||
@@ -887,7 +887,7 @@ suspend inline fun TelegramBot.reply(
|
||||
|
||||
|
||||
suspend inline fun TelegramBot.replyWithVoice(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
voice: InputFile,
|
||||
entities: TextSourcesList,
|
||||
@@ -900,7 +900,7 @@ suspend inline fun TelegramBot.replyWithVoice(
|
||||
) = sendVoice(toChatId, voice, entities, duration, threadId, disableNotification, protectContent, toMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
voice: VoiceFile,
|
||||
entities: TextSourcesList,
|
||||
@@ -919,7 +919,7 @@ suspend inline fun TelegramBot.reply(
|
||||
* as a builder for that
|
||||
*/
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
title: String,
|
||||
description: String,
|
||||
@@ -949,7 +949,7 @@ suspend inline fun TelegramBot.reply(
|
||||
// Polls
|
||||
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
question: String,
|
||||
options: List<String>,
|
||||
@@ -965,7 +965,7 @@ suspend inline fun TelegramBot.reply(
|
||||
) = sendRegularPoll(toChatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, toMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
poll: RegularPoll,
|
||||
isClosed: Boolean = false,
|
||||
@@ -982,7 +982,7 @@ suspend inline fun TelegramBot.reply(
|
||||
) = sendRegularPoll(toChatId, poll, isClosed, question, options, isAnonymous, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, toMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
question: String,
|
||||
options: List<String>,
|
||||
@@ -1000,7 +1000,7 @@ suspend inline fun TelegramBot.reply(
|
||||
) = sendQuizPoll(toChatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, toMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
quizPoll: QuizPoll,
|
||||
isClosed: Boolean = false,
|
||||
@@ -1019,7 +1019,7 @@ suspend inline fun TelegramBot.reply(
|
||||
) = sendQuizPoll(toChatId, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, toMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
question: String,
|
||||
options: List<String>,
|
||||
@@ -1036,7 +1036,7 @@ suspend inline fun TelegramBot.reply(
|
||||
) = sendQuizPoll(toChatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, toMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
quizPoll: QuizPoll,
|
||||
entities: TextSourcesList,
|
||||
@@ -1055,7 +1055,7 @@ suspend inline fun TelegramBot.reply(
|
||||
|
||||
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
poll: Poll,
|
||||
isClosed: Boolean = false,
|
||||
@@ -1106,7 +1106,7 @@ suspend inline fun TelegramBot.reply(
|
||||
|
||||
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
fromChatId: ChatIdentifier,
|
||||
messageId: MessageId,
|
||||
@@ -1132,7 +1132,7 @@ suspend inline fun TelegramBot.reply(
|
||||
)
|
||||
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
fromChat: Chat,
|
||||
messageId: MessageId,
|
||||
@@ -1146,7 +1146,7 @@ suspend inline fun TelegramBot.reply(
|
||||
) = reply(toChatId, toMessageId, fromChat.id, messageId, text, parseMode, threadId, disableNotification, protectContent, allowSendingWithoutReply, replyMarkup)
|
||||
|
||||
suspend inline fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
copy: Message,
|
||||
text: String? = null,
|
||||
@@ -1159,7 +1159,7 @@ suspend inline fun TelegramBot.reply(
|
||||
) = reply(toChatId, toMessageId, copy.chat.id, copy.messageId, text, parseMode, threadId, disableNotification, protectContent, allowSendingWithoutReply, replyMarkup)
|
||||
|
||||
suspend fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
content: MessageContent,
|
||||
threadId: MessageThreadId? = null,
|
||||
@@ -1187,7 +1187,7 @@ suspend fun TelegramBot.reply(
|
||||
* @see handleLiveLocation
|
||||
*/
|
||||
suspend fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
locationsFlow: Flow<EditLiveLocationInfo>,
|
||||
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
||||
@@ -1214,7 +1214,7 @@ suspend fun TelegramBot.reply(
|
||||
@JvmName("replyLiveLocationWithLocationChatIdAndMessageId")
|
||||
@JsName("replyLiveLocationWithLocationChatIdAndMessageId")
|
||||
suspend fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
locationsFlow: Flow<Location>,
|
||||
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
||||
@@ -1243,7 +1243,7 @@ suspend fun TelegramBot.reply(
|
||||
@JvmName("replyLiveLocationWithLatLongChatIdAndMessageId")
|
||||
@JsName("replyLiveLocationWithLatLongChatIdAndMessageId")
|
||||
suspend fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
locationsFlow: Flow<Pair<Double, Double>>,
|
||||
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
||||
@@ -1265,7 +1265,7 @@ suspend fun TelegramBot.reply(
|
||||
}
|
||||
|
||||
suspend fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
mediaFile: TelegramMediaFile,
|
||||
threadId: MessageThreadId? = null,
|
||||
@@ -1369,7 +1369,7 @@ suspend fun TelegramBot.reply(
|
||||
}
|
||||
|
||||
suspend fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
content: TextedMediaContent,
|
||||
text: String?,
|
||||
@@ -1457,7 +1457,7 @@ suspend fun TelegramBot.reply(
|
||||
}
|
||||
|
||||
suspend fun TelegramBot.reply(
|
||||
toChatId: ChatId,
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
content: TextedMediaContent,
|
||||
entities: List<TextSource>,
|
||||
|
@@ -9,7 +9,6 @@ import dev.inmo.tgbotapi.types.actions.*
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import kotlinx.coroutines.*
|
||||
import kotlin.contracts.*
|
||||
import kotlin.coroutines.coroutineContext
|
||||
|
||||
private const val refreshTime: MilliSeconds = (botActionActualityTime - 1) * 1000L
|
||||
typealias TelegramBotActionCallback<T> = suspend TelegramBot.() -> T
|
||||
@@ -37,7 +36,7 @@ suspend fun <T> TelegramBot.withAction(
|
||||
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withAction(
|
||||
chatId: ChatId,
|
||||
chatId: IdChatIdentifier,
|
||||
action: BotAction,
|
||||
block: TelegramBotActionCallback<T>
|
||||
): T {
|
||||
@@ -67,77 +66,77 @@ suspend fun <T> TelegramBot.withAction(
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withTypingAction(chatId: ChatId, block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withTypingAction(chatId: IdChatIdentifier, block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(chatId, TypingAction, block)
|
||||
}
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withUploadPhotoAction(chatId: ChatId, block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withUploadPhotoAction(chatId: IdChatIdentifier, block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(chatId, UploadPhotoAction, block)
|
||||
}
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withRecordVideoAction(chatId: ChatId, block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withRecordVideoAction(chatId: IdChatIdentifier, block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(chatId, RecordVideoAction, block)
|
||||
}
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withUploadVideoAction(chatId: ChatId, block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withUploadVideoAction(chatId: IdChatIdentifier, block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(chatId, UploadVideoAction, block)
|
||||
}
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withRecordVoiceAction(chatId: ChatId, block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withRecordVoiceAction(chatId: IdChatIdentifier, block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(chatId, RecordVoiceAction, block)
|
||||
}
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withUploadVoiceAction(chatId: ChatId, block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withUploadVoiceAction(chatId: IdChatIdentifier, block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(chatId, UploadVoiceAction, block)
|
||||
}
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withUploadDocumentAction(chatId: ChatId, block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withUploadDocumentAction(chatId: IdChatIdentifier, block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(chatId, UploadDocumentAction, block)
|
||||
}
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withFindLocationAction(chatId: ChatId, block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withFindLocationAction(chatId: IdChatIdentifier, block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(chatId, FindLocationAction, block)
|
||||
}
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withRecordVideoNoteAction(chatId: ChatId, block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withRecordVideoNoteAction(chatId: IdChatIdentifier, block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(chatId, RecordVideoNoteAction, block)
|
||||
}
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withUploadVideoNoteAction(chatId: ChatId, block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withUploadVideoNoteAction(chatId: IdChatIdentifier, block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(chatId, UploadVideoNoteAction, block)
|
||||
}
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withChooseStickerAction(chatId: ChatId, block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withChooseStickerAction(chatId: IdChatIdentifier, block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
|
@@ -414,7 +414,7 @@ suspend fun TelegramBot.send(
|
||||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.send(
|
||||
chatId: ChatId,
|
||||
chatId: IdChatIdentifier,
|
||||
title: String,
|
||||
description: String,
|
||||
payload: String,
|
||||
|
@@ -11,6 +11,7 @@ import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.files.VoiceFile
|
||||
import dev.inmo.tgbotapi.types.threadId
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -22,7 +23,7 @@ suspend fun TelegramBot.sendVoice(
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
duration: Long? = null,
|
||||
threadId: MessageThreadId? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
@@ -54,7 +55,7 @@ suspend fun TelegramBot.sendVoice(
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
duration: Long? = null,
|
||||
threadId: MessageThreadId? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
@@ -71,7 +72,7 @@ suspend fun TelegramBot.sendVoice(
|
||||
voice: VoiceFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
@@ -90,7 +91,7 @@ suspend fun TelegramBot.sendVoice(
|
||||
voice: VoiceFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
@@ -108,7 +109,7 @@ suspend inline fun TelegramBot.sendVoice(
|
||||
voice: InputFile,
|
||||
entities: TextSourcesList,
|
||||
duration: Long? = null,
|
||||
threadId: MessageThreadId? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
@@ -138,7 +139,7 @@ suspend inline fun TelegramBot.sendVoice(
|
||||
voice: InputFile,
|
||||
entities: TextSourcesList,
|
||||
duration: Long? = null,
|
||||
threadId: MessageThreadId? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
@@ -154,7 +155,7 @@ suspend inline fun TelegramBot.sendVoice(
|
||||
chatId: ChatIdentifier,
|
||||
voice: VoiceFile,
|
||||
entities: TextSourcesList,
|
||||
threadId: MessageThreadId? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
@@ -171,7 +172,7 @@ suspend inline fun TelegramBot.sendVoice(
|
||||
chat: Chat,
|
||||
voice: VoiceFile,
|
||||
entities: TextSourcesList,
|
||||
threadId: MessageThreadId? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
|
@@ -13,7 +13,7 @@ import dev.inmo.tgbotapi.types.payments.abstracts.Currency
|
||||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.sendInvoice(
|
||||
chatId: ChatId,
|
||||
chatId: IdChatIdentifier,
|
||||
title: String,
|
||||
description: String,
|
||||
payload: String,
|
||||
@@ -31,7 +31,7 @@ suspend fun TelegramBot.sendInvoice(
|
||||
shouldSendPhoneNumberToProvider: Boolean = false,
|
||||
shouldSendEmailToProvider: Boolean = false,
|
||||
priceDependOnShipAddress: Boolean = false,
|
||||
threadId: MessageThreadId? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
|
@@ -11,6 +11,7 @@ import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.polls.*
|
||||
import dev.inmo.tgbotapi.types.threadId
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -24,7 +25,7 @@ suspend fun TelegramBot.sendRegularPoll(
|
||||
isClosed: Boolean = false,
|
||||
allowMultipleAnswers: Boolean = false,
|
||||
closeInfo: ScheduledCloseInfo? = null,
|
||||
threadId: MessageThreadId? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
@@ -48,7 +49,7 @@ suspend fun TelegramBot.sendRegularPoll(
|
||||
isAnonymous: Boolean = poll.isAnonymous,
|
||||
allowMultipleAnswers: Boolean = poll.allowMultipleAnswers,
|
||||
closeInfo: ScheduledCloseInfo? = null,
|
||||
threadId: MessageThreadId? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
@@ -68,7 +69,7 @@ suspend fun TelegramBot.sendRegularPoll(
|
||||
isClosed: Boolean = false,
|
||||
allowMultipleAnswers: Boolean = false,
|
||||
closeInfo: ScheduledCloseInfo? = null,
|
||||
threadId: MessageThreadId? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
@@ -91,7 +92,7 @@ suspend fun TelegramBot.sendRegularPoll(
|
||||
isAnonymous: Boolean = poll.isAnonymous,
|
||||
allowMultipleAnswers: Boolean = poll.allowMultipleAnswers,
|
||||
closeInfo: ScheduledCloseInfo? = null,
|
||||
threadId: MessageThreadId? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
@@ -116,7 +117,7 @@ suspend fun TelegramBot.sendQuizPoll(
|
||||
explanation: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
closeInfo: ScheduledCloseInfo? = null,
|
||||
threadId: MessageThreadId? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
@@ -142,7 +143,7 @@ suspend fun TelegramBot.sendQuizPoll(
|
||||
explanation: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
closeInfo: ScheduledCloseInfo? = null,
|
||||
threadId: MessageThreadId? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
@@ -167,7 +168,7 @@ suspend fun TelegramBot.sendQuizPoll(
|
||||
explanation: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
closeInfo: ScheduledCloseInfo? = null,
|
||||
threadId: MessageThreadId? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
@@ -192,7 +193,7 @@ suspend fun TelegramBot.sendQuizPoll(
|
||||
explanation: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
closeInfo: ScheduledCloseInfo? = null,
|
||||
threadId: MessageThreadId? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
@@ -216,7 +217,7 @@ suspend inline fun TelegramBot.sendQuizPoll(
|
||||
isClosed: Boolean = false,
|
||||
entities: TextSourcesList,
|
||||
closeInfo: ScheduledCloseInfo? = null,
|
||||
threadId: MessageThreadId? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
@@ -241,7 +242,7 @@ suspend inline fun TelegramBot.sendQuizPoll(
|
||||
isClosed: Boolean = false,
|
||||
entities: TextSourcesList,
|
||||
closeInfo: ScheduledCloseInfo? = null,
|
||||
threadId: MessageThreadId? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
@@ -265,7 +266,7 @@ suspend inline fun TelegramBot.sendQuizPoll(
|
||||
isAnonymous: Boolean = quizPoll.isAnonymous,
|
||||
entities: TextSourcesList,
|
||||
closeInfo: ScheduledCloseInfo? = null,
|
||||
threadId: MessageThreadId? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
@@ -289,7 +290,7 @@ suspend inline fun TelegramBot.sendQuizPoll(
|
||||
isAnonymous: Boolean = quizPoll.isAnonymous,
|
||||
entities: TextSourcesList,
|
||||
closeInfo: ScheduledCloseInfo? = null,
|
||||
threadId: MessageThreadId? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
|
Reference in New Issue
Block a user