2020-10-04 10:57:39 +00:00
|
|
|
package dev.inmo.tgbotapi.extensions.api.send
|
2020-02-15 09:33:04 +00:00
|
|
|
|
2020-10-04 11:06:30 +00:00
|
|
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
|
|
import dev.inmo.tgbotapi.requests.send.SendTextMessage
|
|
|
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
2021-05-29 09:34:14 +00:00
|
|
|
import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSourcesList
|
2020-10-04 11:06:30 +00:00
|
|
|
import dev.inmo.tgbotapi.types.MessageIdentifier
|
|
|
|
import dev.inmo.tgbotapi.types.ParseMode.ParseMode
|
|
|
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
|
|
|
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
2020-02-15 09:33:04 +00:00
|
|
|
|
2021-10-01 13:38:22 +00:00
|
|
|
/**
|
|
|
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
|
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
|
|
*/
|
2020-10-04 07:18:24 +00:00
|
|
|
suspend fun TelegramBot.sendMessage(
|
2020-02-15 09:33:04 +00:00
|
|
|
chatId: ChatIdentifier,
|
|
|
|
text: String,
|
|
|
|
parseMode: ParseMode? = null,
|
|
|
|
disableWebPagePreview: Boolean? = null,
|
|
|
|
disableNotification: Boolean = false,
|
|
|
|
replyToMessageId: MessageIdentifier? = null,
|
2020-11-05 17:48:23 +00:00
|
|
|
allowSendingWithoutReply: Boolean? = null,
|
2020-02-15 09:33:04 +00:00
|
|
|
replyMarkup: KeyboardMarkup? = null
|
|
|
|
) = execute(
|
2020-11-05 17:48:23 +00:00
|
|
|
SendTextMessage(chatId, text, parseMode, disableWebPagePreview, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
2020-02-15 09:33:04 +00:00
|
|
|
)
|
|
|
|
|
2021-10-01 13:38:22 +00:00
|
|
|
/**
|
|
|
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
|
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
|
|
*/
|
2020-10-04 07:18:24 +00:00
|
|
|
suspend fun TelegramBot.sendTextMessage(
|
2020-02-15 09:33:04 +00:00
|
|
|
chatId: ChatIdentifier,
|
|
|
|
text: String,
|
|
|
|
parseMode: ParseMode? = null,
|
|
|
|
disableWebPagePreview: Boolean? = null,
|
|
|
|
disableNotification: Boolean = false,
|
|
|
|
replyToMessageId: MessageIdentifier? = null,
|
2020-11-05 17:48:23 +00:00
|
|
|
allowSendingWithoutReply: Boolean? = null,
|
2020-02-15 09:33:04 +00:00
|
|
|
replyMarkup: KeyboardMarkup? = null
|
|
|
|
) = sendMessage(
|
2020-11-05 17:48:23 +00:00
|
|
|
chatId, text, parseMode, disableWebPagePreview, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
2020-02-15 09:33:04 +00:00
|
|
|
)
|
|
|
|
|
2021-10-01 13:38:22 +00:00
|
|
|
/**
|
|
|
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
|
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
|
|
*/
|
2020-10-04 07:18:24 +00:00
|
|
|
suspend fun TelegramBot.sendMessage(
|
2020-02-15 09:33:04 +00:00
|
|
|
chat: Chat,
|
|
|
|
text: String,
|
|
|
|
parseMode: ParseMode? = null,
|
|
|
|
disableWebPagePreview: Boolean? = null,
|
|
|
|
disableNotification: Boolean = false,
|
|
|
|
replyToMessageId: MessageIdentifier? = null,
|
2020-11-05 17:48:23 +00:00
|
|
|
allowSendingWithoutReply: Boolean? = null,
|
2020-02-15 09:33:04 +00:00
|
|
|
replyMarkup: KeyboardMarkup? = null
|
2020-11-05 17:48:23 +00:00
|
|
|
) = sendMessage(chat.id, text, parseMode, disableWebPagePreview, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
2020-02-15 09:33:04 +00:00
|
|
|
|
|
|
|
|
2021-10-01 13:38:22 +00:00
|
|
|
/**
|
|
|
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
|
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
|
|
*/
|
2020-10-04 07:18:24 +00:00
|
|
|
suspend fun TelegramBot.sendTextMessage(
|
2020-02-15 09:33:04 +00:00
|
|
|
chat: Chat,
|
|
|
|
text: String,
|
|
|
|
parseMode: ParseMode? = null,
|
|
|
|
disableWebPagePreview: Boolean? = null,
|
|
|
|
disableNotification: Boolean = false,
|
|
|
|
replyToMessageId: MessageIdentifier? = null,
|
2020-11-05 17:48:23 +00:00
|
|
|
allowSendingWithoutReply: Boolean? = null,
|
2020-02-15 09:33:04 +00:00
|
|
|
replyMarkup: KeyboardMarkup? = null
|
2020-11-05 17:48:23 +00:00
|
|
|
) = sendTextMessage(chat.id, text, parseMode, disableWebPagePreview, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
|
|
|
|
2021-10-01 13:38:22 +00:00
|
|
|
/**
|
|
|
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
|
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
|
|
*/
|
2020-11-05 17:48:23 +00:00
|
|
|
suspend fun TelegramBot.sendMessage(
|
|
|
|
chatId: ChatIdentifier,
|
2021-05-29 09:34:14 +00:00
|
|
|
entities: TextSourcesList,
|
2020-11-05 17:48:23 +00:00
|
|
|
disableWebPagePreview: Boolean? = null,
|
|
|
|
disableNotification: Boolean = false,
|
|
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
|
|
allowSendingWithoutReply: Boolean? = null,
|
|
|
|
replyMarkup: KeyboardMarkup? = null
|
|
|
|
) = execute(
|
|
|
|
SendTextMessage(chatId, entities, disableWebPagePreview, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
|
|
|
)
|
|
|
|
|
2021-10-01 13:38:22 +00:00
|
|
|
/**
|
|
|
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
|
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
|
|
*/
|
2020-11-05 17:48:23 +00:00
|
|
|
suspend fun TelegramBot.sendTextMessage(
|
|
|
|
chatId: ChatIdentifier,
|
2021-05-29 09:34:14 +00:00
|
|
|
entities: TextSourcesList,
|
2020-11-05 17:48:23 +00:00
|
|
|
disableWebPagePreview: Boolean? = null,
|
|
|
|
disableNotification: Boolean = false,
|
|
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
|
|
allowSendingWithoutReply: Boolean? = null,
|
|
|
|
replyMarkup: KeyboardMarkup? = null
|
|
|
|
) = sendMessage(
|
|
|
|
chatId, entities, disableWebPagePreview, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
|
|
|
)
|
|
|
|
|
2021-10-01 13:38:22 +00:00
|
|
|
/**
|
|
|
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
|
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
|
|
*/
|
2020-11-05 17:48:23 +00:00
|
|
|
suspend fun TelegramBot.sendMessage(
|
|
|
|
chat: Chat,
|
2021-05-29 09:34:14 +00:00
|
|
|
entities: TextSourcesList,
|
2020-11-05 17:48:23 +00:00
|
|
|
disableWebPagePreview: Boolean? = null,
|
|
|
|
disableNotification: Boolean = false,
|
|
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
|
|
allowSendingWithoutReply: Boolean? = null,
|
|
|
|
replyMarkup: KeyboardMarkup? = null
|
|
|
|
) = sendMessage(chat.id, entities, disableWebPagePreview, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
|
|
|
|
|
|
|
|
2021-10-01 13:38:22 +00:00
|
|
|
/**
|
|
|
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
|
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
|
|
*/
|
2020-11-05 17:48:23 +00:00
|
|
|
suspend fun TelegramBot.sendTextMessage(
|
|
|
|
chat: Chat,
|
2021-05-29 09:34:14 +00:00
|
|
|
entities: TextSourcesList,
|
2020-11-05 17:48:23 +00:00
|
|
|
disableWebPagePreview: Boolean? = null,
|
|
|
|
disableNotification: Boolean = false,
|
|
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
|
|
allowSendingWithoutReply: Boolean? = null,
|
|
|
|
replyMarkup: KeyboardMarkup? = null
|
|
|
|
) = sendTextMessage(chat.id, entities, disableWebPagePreview, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|