-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #747 from InsanusMokrassar/7.1.0
7.1.0
- Loading branch information
Showing
28 changed files
with
650 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/GetMyName.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package dev.inmo.tgbotapi.extensions.api.bot | ||
|
||
import dev.inmo.micro_utils.language_codes.IetfLanguageCode | ||
import dev.inmo.tgbotapi.bot.TelegramBot | ||
import dev.inmo.tgbotapi.requests.bot.GetMyCommands | ||
import dev.inmo.tgbotapi.requests.bot.GetMyName | ||
import dev.inmo.tgbotapi.types.commands.BotCommandScope | ||
import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault | ||
|
||
suspend fun TelegramBot.getMyName( | ||
languageCode: IetfLanguageCode? = null | ||
) = execute(GetMyName(languageCode)) | ||
|
||
suspend fun TelegramBot.getMyName( | ||
languageCode: String? | ||
) = getMyName(languageCode ?.let(::IetfLanguageCode)) |
19 changes: 19 additions & 0 deletions
19
tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/bot/SetMyName.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package dev.inmo.tgbotapi.extensions.api.bot | ||
|
||
import dev.inmo.micro_utils.language_codes.IetfLanguageCode | ||
import dev.inmo.tgbotapi.bot.TelegramBot | ||
import dev.inmo.tgbotapi.requests.bot.GetMyCommands | ||
import dev.inmo.tgbotapi.requests.bot.GetMyName | ||
import dev.inmo.tgbotapi.requests.bot.SetMyName | ||
import dev.inmo.tgbotapi.types.commands.BotCommandScope | ||
import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault | ||
|
||
suspend fun TelegramBot.setMyName( | ||
name: String? = null, | ||
languageCode: IetfLanguageCode? = null | ||
) = execute(SetMyName(name, languageCode)) | ||
|
||
suspend fun TelegramBot.setMyName( | ||
name: String?, | ||
languageCode: String? | ||
) = setMyName(name, languageCode ?.let(::IetfLanguageCode)) |
114 changes: 114 additions & 0 deletions
114
tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/InlineEdits.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
package dev.inmo.tgbotapi.extensions.api.edit | ||
|
||
import dev.inmo.tgbotapi.abstracts.TextedWithTextSources | ||
import dev.inmo.tgbotapi.bot.TelegramBot | ||
import dev.inmo.tgbotapi.extensions.api.edit.caption.editMessageCaption | ||
import dev.inmo.tgbotapi.extensions.api.edit.location.live.editLiveLocation | ||
import dev.inmo.tgbotapi.extensions.api.edit.media.editMessageMedia | ||
import dev.inmo.tgbotapi.extensions.api.edit.reply_markup.editMessageReplyMarkup | ||
import dev.inmo.tgbotapi.extensions.api.edit.text.editMessageText | ||
import dev.inmo.tgbotapi.types.* | ||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup | ||
import dev.inmo.tgbotapi.types.chat.Chat | ||
import dev.inmo.tgbotapi.types.location.LiveLocation | ||
import dev.inmo.tgbotapi.types.media.TelegramMedia | ||
import dev.inmo.tgbotapi.types.message.ParseMode | ||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage | ||
import dev.inmo.tgbotapi.types.message.abstracts.Message | ||
import dev.inmo.tgbotapi.types.message.content.* | ||
import dev.inmo.tgbotapi.types.message.textsources.TextSource | ||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList | ||
import dev.inmo.tgbotapi.utils.EntitiesBuilderBody | ||
import dev.inmo.tgbotapi.utils.buildEntities | ||
|
||
/** | ||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] | ||
* as a builder for that | ||
*/ | ||
suspend fun TelegramBot.edit( | ||
messageId: InlineMessageIdentifier, | ||
latitude: Double, | ||
longitude: Double, | ||
horizontalAccuracy: Meters? = null, | ||
heading: Degrees? = null, | ||
proximityAlertRadius: Meters? = null, | ||
replyMarkup: InlineKeyboardMarkup? = null | ||
) = editLiveLocation(messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup) | ||
|
||
/** | ||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] | ||
* as a builder for that | ||
*/ | ||
suspend fun TelegramBot.edit( | ||
messageId: InlineMessageIdentifier, | ||
location: LiveLocation, | ||
replyMarkup: InlineKeyboardMarkup? = null | ||
) = editLiveLocation( | ||
messageId, location, replyMarkup | ||
) | ||
|
||
/** | ||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] | ||
* as a builder for that | ||
*/ | ||
suspend fun TelegramBot.edit( | ||
messageId: InlineMessageIdentifier, | ||
media: TelegramMedia, | ||
replyMarkup: InlineKeyboardMarkup? = null | ||
) = editMessageMedia(messageId, media, replyMarkup) | ||
|
||
/** | ||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] | ||
* as a builder for that | ||
*/ | ||
suspend fun TelegramBot.edit( | ||
messageId: InlineMessageIdentifier, | ||
replyMarkup: InlineKeyboardMarkup? = null | ||
) = editMessageReplyMarkup(messageId, replyMarkup) | ||
|
||
/** | ||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] | ||
* as a builder for that | ||
*/ | ||
suspend fun TelegramBot.edit( | ||
messageId: InlineMessageIdentifier, | ||
text: String, | ||
parseMode: ParseMode? = null, | ||
disableWebPagePreview: Boolean? = null, | ||
replyMarkup: InlineKeyboardMarkup? = null | ||
) = editMessageText(messageId, text, parseMode, disableWebPagePreview, replyMarkup) | ||
|
||
/** | ||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] | ||
* as a builder for that | ||
*/ | ||
suspend fun TelegramBot.edit( | ||
messageId: InlineMessageIdentifier, | ||
entities: TextSourcesList, | ||
disableWebPagePreview: Boolean? = null, | ||
replyMarkup: InlineKeyboardMarkup? = null | ||
) = editMessageText(messageId, entities, disableWebPagePreview, replyMarkup) | ||
|
||
/** | ||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] | ||
* as a builder for that | ||
*/ | ||
suspend fun TelegramBot.edit( | ||
messageId: InlineMessageIdentifier, | ||
separator: TextSource? = null, | ||
disableWebPagePreview: Boolean? = null, | ||
replyMarkup: InlineKeyboardMarkup? = null, | ||
builderBody: EntitiesBuilderBody | ||
) = edit(messageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup) | ||
|
||
/** | ||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] | ||
* as a builder for that | ||
*/ | ||
suspend fun TelegramBot.edit( | ||
messageId: InlineMessageIdentifier, | ||
separator: String, | ||
disableWebPagePreview: Boolean? = null, | ||
replyMarkup: InlineKeyboardMarkup? = null, | ||
builderBody: EntitiesBuilderBody | ||
) = edit(messageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.