Page 7 of 7

Re: PureTelegram (framework for using the Telegram API)

Posted: Wed Jun 25, 2025 10:32 am
by infratec
comment it out.

Or:

Code: Select all

CompilerIf #PB_Compiler_Version < 600
  InitNetwork()
CompilerEndIf

Re: PureTelegram (framework for using the Telegram API)

Posted: Wed Jun 25, 2025 10:45 am
by dibor
Hi.
Thank U, I did that, but doesn't help
I got error: ERROR: *{"ok":false,"error_code":404,"description":"Not Found"}* with simple example:

Code: Select all

XIncludeFile "PureTelegram.pbi"
#BotAPIToken = "[your bot's API token]"
#ChatID = "[your chat's ID or username]"

txt.s = "Hello Telegram world."
mid.i = Telegram_PostText(#BotAPIToken,#ChatID,txt)
Of course I put API token and ChatID

What I do wrong?

Re: PureTelegram (framework for using the Telegram API)

Posted: Wed Jun 25, 2025 10:56 am
by Caronte3D
dibor wrote: Wed Jun 25, 2025 10:45 am Of course I put API token and ChatID
Your ChatID start with a: "-" (minus sign)?
If not, try to add it and test it again.

Re: PureTelegram (framework for using the Telegram API)

Posted: Wed Jun 25, 2025 11:12 am
by dibor
Hi
I did exact as in the module help.
ChatID with @username or chat number
Have tried with and w/o "-" , doesn't work :(

:(

Re: PureTelegram (framework for using the Telegram API)

Posted: Wed Jun 25, 2025 11:18 am
by Caronte3D
For me, this works in a Telegram Group (the group must be open to everybody).

BTW... Have you created and added the Telegram bot to the group?

Re: PureTelegram (framework for using the Telegram API)

Posted: Wed Jun 25, 2025 11:19 am
by dibor
I did it privet, will do public and will check.

Thank U

Re: PureTelegram (framework for using the Telegram API)

Posted: Wed Jun 25, 2025 11:50 am
by dibor
Caronte3D wrote: Wed Jun 25, 2025 11:18 am BTW... Have you created and added the Telegram bot to the group?
Yes

Re: PureTelegram (framework for using the Telegram API)

Posted: Wed Jun 25, 2025 1:01 pm
by dibor
Nothing work :(
Looks like I am too stupid :(

Re: PureTelegram (framework for using the Telegram API)

Posted: Wed Jun 25, 2025 2:02 pm
by Caronte3D
Check if your tokens look like mine:

Code: Select all

#ChatIDWD      = "-1305835971919" ; GroupID
#BotAPITokenWD = "5640952673:AAB2ZZ1Vq6peruVnwIxYbu3qrgE68pyaKX8"
Telegram_PostText(#BotAPITokenWD, #ChatIDWD, "⚠️ Warning!")
BTW: obviously on this example I modified my tokens, but you can get an idea of form.

Re: PureTelegram (framework for using the Telegram API)

Posted: Wed Jun 25, 2025 3:00 pm
by dibor
Hi.
My example looks same:

Code: Select all

XIncludeFile "PureTelegram.pbi"
#BotAPIToken = "[7620816597:AAHhBvBM9qqlZ1arXJKmhFGTR_EfFcwaPGk]"
#ChatID = "[1701234043]"

txt.s = "Test"
mid.i = Telegram_PostText(#BotAPIToken,#ChatID,txt)

Re: PureTelegram (framework for using the Telegram API)

Posted: Wed Jun 25, 2025 3:05 pm
by dibor
I am stupid idiot, was use [] .
As was in the example:

Code: Select all

#BotAPIToken = "[your bot's API token]"
#ChatID = "[your chat's ID or username]"
:oops:

Re: PureTelegram (framework for using the Telegram API)

Posted: Wed Jun 25, 2025 4:12 pm
by Caronte3D
You're welcome! :lol: