From a74b588cba097a632df4739588e874bb9d9f9ae0 Mon Sep 17 00:00:00 2001 From: Sambo Chea Date: Fri, 21 May 2021 09:44:48 +0700 Subject: [PATCH] Add telegram file builder --- .../client/telegram/TelegramFileDocument.kt | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/cubetiqs/messaging/client/telegram/TelegramFileDocument.kt b/src/main/kotlin/com/cubetiqs/messaging/client/telegram/TelegramFileDocument.kt index 4203660..cf4d5de 100644 --- a/src/main/kotlin/com/cubetiqs/messaging/client/telegram/TelegramFileDocument.kt +++ b/src/main/kotlin/com/cubetiqs/messaging/client/telegram/TelegramFileDocument.kt @@ -3,7 +3,7 @@ package com.cubetiqs.messaging.client.telegram import java.io.Serializable /** - * File Document + * Telegram File Document * * @author sombochea * @since 1.0 @@ -13,4 +13,24 @@ open class TelegramFileDocument ( var name: String? = null, var type: String? = null, var extension: String? = null, -) : Serializable \ No newline at end of file +) : Serializable { + fun setFile(file: ByteArray?) = apply { + this.file = file + } + + fun setName(name: String?) = apply { + this.name = name + } + + fun setType(type: String?) = apply { + this.type = type + } + + fun setExtension(extension: String?) = apply { + this.extension = extension + } + + companion object { + fun create() = TelegramFileDocument() + } +} \ No newline at end of file