refactor(client): removed type modification from sendText and sendPhoto return types

This commit is contained in:
teidesu 2021-04-10 11:54:31 +03:00
parent 97e6eb1403
commit 0901f97e0d
4 changed files with 8 additions and 11 deletions

View file

@ -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<filters.Modify<Message, { media: Photo }>> {
): Promise<Message> {
return sendPhoto.apply(this, arguments)
}
/**
@ -866,7 +865,7 @@ export class TelegramClient extends BaseTelegramClient {
*/
replyMarkup?: ReplyMarkup
}
): Promise<filters.Modify<Message, { media: null }>> {
): Promise<Message> {
return sendText.apply(this, arguments)
}
/**

View file

@ -14,7 +14,6 @@ import {
SentCode,
MaybeDynamic,
InputPeerLike,
Photo,
UploadedFile,
UploadFileLike,
InputFileLike,

View file

@ -85,7 +85,7 @@ export async function sendPhoto(
*/
progressCallback?: (uploaded: number, total: number) => void
}
): Promise<filters.Modify<Message, { media: Photo }>> {
): Promise<Message> {
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)
}

View file

@ -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<filters.Modify<Message, { media: null }>> {
): Promise<Message> {
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)
}