1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-09-05 08:09:21 +00:00

editForumtTopic optional fields

This commit is contained in:
2022-12-30 20:32:05 +06:00
parent 8b5da90e28
commit 463d5252bd
2 changed files with 7 additions and 11 deletions

View File

@@ -11,8 +11,8 @@ import dev.inmo.tgbotapi.types.chat.Chat
suspend fun TelegramBot.editForumTopic(
chatId: ChatIdentifier,
messageThreadId: MessageThreadId,
name: String,
iconEmojiId: CustomEmojiId
name: String? = null,
iconEmojiId: CustomEmojiId? = null
) = execute(
EditForumTopic(
chatId,
@@ -25,12 +25,12 @@ suspend fun TelegramBot.editForumTopic(
suspend fun TelegramBot.editForumTopic(
chat: Chat,
messageThreadId: MessageThreadId,
name: String,
iconEmojiId: CustomEmojiId
name: String? = null,
iconEmojiId: CustomEmojiId? = null
) = editForumTopic(chat.id, messageThreadId, name, iconEmojiId)
suspend fun TelegramBot.editForumTopic(
chatIdentifier: ChatIdentifier,
forumTopic: ForumTopic,
iconEmojiId: CustomEmojiId = forumTopic.iconEmojiId ?: error("Icon emoji id in forum topic should be presented when edit forum topic basing on other forum topic object")
iconEmojiId: CustomEmojiId? = forumTopic.iconEmojiId
) = editForumTopic(chatIdentifier, forumTopic.messageThreadId, forumTopic.name, iconEmojiId)