Export events like you export another things
#698 #601
Even I try to make import as you wrote in you documentation
import { TelegramClient } from "telegram";
import { StringSession } from "telegram/sessions";
import { NewMessageEvent } from "telegram/events";
I have problem with exports and ERR_UNSUPPORTED_DIR_IMPORT
So please inject events into main exported object.
It will fix many problems with Events as minimum.
Thanx!
as a workaround you can do.
client.addEventHandler((message) => {
console.log(message);
}, new TelegramClient.events.NewMessage());
You don't need to import events like this.
@painor
Thanx. It works but as workaround.
In general I wanna completely without errors use string
import { NewMessageEvent } from "telegram/events";
Is is possible?
Last time I tried that i ended up with some recursive errors so I have to restructure the imports a bit to make it work for now. So it'll take some time to update that
@painor Please mention me for testing when it would be done.
Thanx!