From 0901f97e0da1001c84f917105d025dd8aca46b5e Mon Sep 17 00:00:00 2001 From: teidesu Date: Sat, 10 Apr 2021 11:54:31 +0300 Subject: [PATCH] refactor(client): removed type modification from sendText and sendPhoto return types --- packages/client/src/client.ts | 7 +++---- packages/client/src/methods/_imports.ts | 1 - packages/client/src/methods/messages/send-photo.ts | 4 ++-- packages/client/src/methods/messages/send-text.ts | 7 +++---- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/packages/client/src/client.ts b/packages/client/src/client.ts index 1fb0fe63..f3b53013 100644 --- a/packages/client/src/client.ts +++ b/packages/client/src/client.ts @@ -53,11 +53,10 @@ import { Readable } from 'stream' import { Chat, FileDownloadParameters, + InputFileLike, InputPeerLike, MaybeDynamic, - InputFileLike, Message, - Photo, PropagationSymbol, ReplyMarkup, SentCode, @@ -809,7 +808,7 @@ export class TelegramClient extends BaseTelegramClient { */ progressCallback?: (uploaded: number, total: number) => void } - ): Promise> { + ): Promise { return sendPhoto.apply(this, arguments) } /** @@ -866,7 +865,7 @@ export class TelegramClient extends BaseTelegramClient { */ replyMarkup?: ReplyMarkup } - ): Promise> { + ): Promise { return sendText.apply(this, arguments) } /** diff --git a/packages/client/src/methods/_imports.ts b/packages/client/src/methods/_imports.ts index bbcea6a0..fd7b0f35 100644 --- a/packages/client/src/methods/_imports.ts +++ b/packages/client/src/methods/_imports.ts @@ -14,7 +14,6 @@ import { SentCode, MaybeDynamic, InputPeerLike, - Photo, UploadedFile, UploadFileLike, InputFileLike, diff --git a/packages/client/src/methods/messages/send-photo.ts b/packages/client/src/methods/messages/send-photo.ts index 8bd0b1aa..de749d10 100644 --- a/packages/client/src/methods/messages/send-photo.ts +++ b/packages/client/src/methods/messages/send-photo.ts @@ -85,7 +85,7 @@ export async function sendPhoto( */ progressCallback?: (uploaded: number, total: number) => void } -): Promise> { +): Promise { if (!params) params = {} let media: tl.TypeInputMedia @@ -145,5 +145,5 @@ export async function sendPhoto( entities, }) - return this._findMessageInUpdate(res) as any + return this._findMessageInUpdate(res) } diff --git a/packages/client/src/methods/messages/send-text.ts b/packages/client/src/methods/messages/send-text.ts index b0076e4f..e36e6674 100644 --- a/packages/client/src/methods/messages/send-text.ts +++ b/packages/client/src/methods/messages/send-text.ts @@ -5,7 +5,6 @@ import { normalizeDate, randomUlong } from '../../utils/misc-utils' import { InputPeerLike, Message, - filters, BotKeyboard, ReplyMarkup, } from '../../types' @@ -66,7 +65,7 @@ export async function sendText( */ replyMarkup?: ReplyMarkup } -): Promise> { +): Promise { if (!params) params = {} const [message, entities] = await this._parseEntities( @@ -107,8 +106,8 @@ export async function sendText( entities: res.entities, } - return new Message(this, msg, {}, {}) as any + return new Message(this, msg, {}, {}) } - return this._findMessageInUpdate(res) as any + return this._findMessageInUpdate(res) }