1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-26 03:58:44 +00:00

add get file info extensions

This commit is contained in:
InsanusMokrassar 2020-02-06 23:12:49 +06:00
parent be4043f3c2
commit 86f1e3ea36

View File

@ -1,8 +1,10 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.get package com.github.insanusmokrassar.TelegramBotAPI.requests.get
import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.files.PathedFile import com.github.insanusmokrassar.TelegramBotAPI.types.files.PathedFile
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.TelegramMediaFile
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.fileIdField import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.fileIdField
import kotlinx.serialization.* import kotlinx.serialization.*
@ -17,3 +19,13 @@ data class GetFile(
override val requestSerializer: SerializationStrategy<*> override val requestSerializer: SerializationStrategy<*>
get() = serializer() get() = serializer()
} }
suspend fun RequestsExecutor.getFileAdditionalInfo(
fileId: FileId
) = execute(
GetFile(fileId)
)
suspend fun RequestsExecutor.getFileAdditionalInfo(
file: TelegramMediaFile
) = getFileAdditionalInfo(file.fileId)