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:
@@ -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}
|
||||
)
|
Reference in New Issue
Block a user