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

add support of deleteStory

This commit is contained in:
2025-05-10 10:28:32 +06:00
parent 3b4fa06924
commit c8c008edd3
4 changed files with 111 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
package dev.inmo.tgbotapi.extensions.api.stories
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.stories.DeleteStory
import dev.inmo.tgbotapi.types.StoryId
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.abstracts.BusinessContentMessage
import dev.inmo.tgbotapi.types.stories.Story
/**
* Deletes a story from a business account
*/
public suspend fun TelegramBot.deleteStory(
businessConnectionId: BusinessConnectionId,
storyId: StoryId
): Boolean = execute(
DeleteStory(
businessConnectionId = businessConnectionId,
storyId = storyId
)
)
public suspend fun TelegramBot.deleteStory(
message: BusinessContentMessage<*>,
storyId: StoryId
): Boolean = deleteStory(
businessConnectionId = with(message) {message.businessConnectionId}, storyId = storyId
)
public suspend fun TelegramBot.deleteStory(
businessConnectionId: BusinessConnectionId,
story: Story
): Boolean = deleteStory(
businessConnectionId = businessConnectionId, storyId = with(story) {story.id}
)
public suspend fun TelegramBot.deleteStory(
message: BusinessContentMessage<*>,
story: Story
): Boolean = deleteStory(
message = message, storyId = with(story) {story.id}
)