module PublishHelperBot.Types open System open Telegram.Bot open Telegram.Bot.Types type ConfigChatId = int64 type CreateYoutubeDlJob = { url: string savePath: string } type CreateYoutubeDlJobSuccess = { task: Guid } type YoutubeDlStateResponse = { state: string } type YoutubeDlError = { message: string } type CreateJobResult = Result type CheckJobResult = Result type CleanJobResult = Result type IYoutubeDlClient = abstract member CreateJob: CreateYoutubeDlJob -> Async abstract member CheckJob: externalId: Guid -> Async abstract member CleanJob: externalId: Guid -> Async type IYoutubeDlService = abstract member AddJob: url: string -> Async type TgServiceConfig = { Client: ITelegramBotClient ChannelId: ConfigChatId AdminChatId: ConfigChatId YoutubeDlClient: IYoutubeDlClient } type RelayCaptionMode = | WithAuthor | Anonymous | Unknown type RelayType = | Text | Photo of media: string * caption: string | Video of video: string * caption: string type RelayArgs = { ReplyChatId: int64 ReplyMessageId: int Relay: RelayType } [] type BotUpdateType = | RelayUpdate of RelayArgs | YoutubeRepost of url: string | Ping | Skip type ITgUpdateHandler = abstract member PostUpdate: Update -> unit type ITgService = abstract member PostRelay: args: RelayArgs -> unit abstract member PostMessageToAdminChat: text: string -> unit abstract member Ping: unit -> unit abstract member PostVideo: url: string * savePath: string * externalId: Guid -> unit