Jump to content

Working with telegram desktop (no UDF for web/http interaction)


Newb
 Share

Recommended Posts

Hello,
I was trying to use autoit to interact with telegram desktop because I need to automate file uploading, expecially for folders with a lot of files.

I saw there are various UDF libs for Telegram already (to my pleasure, I must say), but looks like they're for direct interaction with telegram API, so kinda to use them with a bot.

Unfortunately bot file management is severely limited in size of files (20mb compared to 4gb on premium normal user) and other aspects.

Therefore my last choice was to automate in some way telegram desktop in a way that directly interacts with the window (WinGetHandle, WinExists, etc etc.).

Unfortunately, probably due to the fact that as I understood telegram is packed with electron, and electron AFAIK just displays a webapp into an exe,, trying to use Window Info tool doesn't give any result beside a main window, which has the current chat name and a random number.

The only way to grab it is by classname like this:

 

Func Window_Telegram_GetHandle()
    Return WinGetHandle("[CLASS:" & $WindowClass_Telegram & "]")
EndFunc

Func Window_Telegram_GetHandle()
    Return WinGetHandle("[CLASS:" & $WindowClass_Telegram & "]")
EndFunc

 

But I'm unable to catch any other button/UI element info with the telegram application. They all give the same handle info of the main page.
I tried to disable/enable Spy++ detection logic but nothing changed.

This leaves me to 3 roads:
1) Maybe there is another way to detect the handles and I don't know?
2) Trying some injector (https://github.com/itsKaynine/electron-injector for example) to inject html/js directly and interact with it

3) Download telegram desktop source code and do it by yself but I think it will take too much time.


Anyone has suggestions/help?

I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...