From beab76e64c105fa4169db3b050de98560451d344 Mon Sep 17 00:00:00 2001 From: Loskir Date: Thu, 14 Jan 2021 15:37:53 +0300 Subject: [PATCH] Use typegram instead of telegram-typings --- package.json | 2 +- typings/telegram-types.d.ts | 91 +++++++------------------------------ 2 files changed, 18 insertions(+), 75 deletions(-) diff --git a/package.json b/package.json index bee6b14da..5bd7f1271 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "module-alias": "^2.2.2", "node-fetch": "^2.2.0", "sandwich-stream": "^2.0.1", - "telegram-typings": "^3.6.0" + "typegram": "^3.1.5" }, "devDependencies": { "@types/node": "^13.1.0", diff --git a/typings/telegram-types.d.ts b/typings/telegram-types.d.ts index d8bbc4a49..b13ddae13 100644 --- a/typings/telegram-types.d.ts +++ b/typings/telegram-types.d.ts @@ -1,5 +1,4 @@ -import * as TT from "telegram-typings"; -export * from "telegram-typings"; +import * as TT from 'typegram' export type ParseMode = 'Markdown' | 'MarkdownV2' | 'HTML' @@ -350,7 +349,7 @@ export interface ExtraDocument extends ExtraReplyMessage { * Document caption (may also be used when resending documents by file_id), 0-1024 characters */ caption?: string - + /** * List of special entities that appear in the caption, which can be specified instead of parse_mode */ @@ -602,77 +601,21 @@ export interface ExtraUnban { only_if_banned?: Boolean } -export interface IncomingMessage extends TT.Message { - audio?: TT.Audio - entities?: TT.MessageEntity[] - caption?: string - document?: TT.Document - game?: TT.Game - photo?: TT.PhotoSize[] - animation?: TT.Animation - sticker?: TT.Sticker - video?: TT.Video - video_note?: TT.VideoNote - contact?: TT.Contact - location?: TT.Location - venue?: TT.Venue - pinned_message?: TT.Message - invoice?: TT.Invoice - successful_payment?: TT.SuccessfulPayment - dice?: Dice -} - -export interface MessageAudio extends TT.Message { - audio: TT.Audio -} - -export interface MessageDocument extends TT.Message { - document: TT.Document -} - -export interface MessageGame extends TT.Message { - game: TT.Game -} - -export interface MessageInvoice extends TT.Message { - invoice: TT.Invoice -} - -export interface MessageLocation extends TT.Message { - location: TT.Location -} - -export interface MessagePhoto extends TT.Message { - photo: TT.PhotoSize[] -} - -export interface MessageAnimation extends TT.Message { - animation: TT.Animation -} - -export interface MessageSticker extends TT.Message { - sticker: TT.Sticker -} - -export interface MessageVideo extends TT.Message { - video: TT.Video -} - -export interface MessageVideoNote extends TT.Message { - video_note: TT.VideoNote -} - -export interface MessageVoice extends TT.Message { - voice: TT.Voice -} - -export interface MessageDice extends TT.Message { - dice: Dice -} - -export interface MessagePoll extends TT.Message { - poll: Poll -} +export type IncomingMessage = TT.Message + +export type MessageAudio = TT.Message.AudioMessage +export type MessageDocument = TT.Message.DocumentMessage +export type MessageGame = TT.Message.GameMessage +export type MessageInvoice = TT.Message.InvoiceMessage +export type MessageLocation = TT.Message.LocationMessage +export type MessagePhoto = TT.Message.PhotoMessage +export type MessageAnimation = TT.Message.AnimationMessage +export type MessageSticker = TT.Message.StickerMessage +export type MessageVideo = TT.Message.VideoMessage +export type MessageVideoNote = TT.Message.VideoNoteMessage +export type MessageVoice = TT.Message.VoiceMessage +export type MessageDice = TT.Message.DiceMessage +export type MessagePoll = TT.Message.PollMessage export interface NewInvoiceParameters { /**