Browse Source

update main.ts example

painor 4 years ago
parent
commit
73f22ffdfb
1 changed files with 2 additions and 1 deletions
  1. 2 1
      examples/main.ts

+ 2 - 1
examples/main.ts

@@ -3,13 +3,14 @@ import {TelegramClient} from "telegram";
 import {StringSession} from "telegram/sessions";
 import {NewMessage} from "telegram/events";
 import {NewMessageEvent} from "telegram/events/NewMessage";
+import {Message} from 'telegram/tl/custom/message';
 
 const apiId = ;
 const apiHash = '';
 const stringSession = '';
 
 async function eventPrint(event: NewMessageEvent) {
-    const message = event.message;
+    const message = event.message as Message;
 
     // Checks if it's a private message (from user or bot)
     if (event.isPrivate){