PureTelegram (framework for using the Telegram API)
-
- Enthusiast
- Posts: 790
- Joined: Sat Aug 09, 2003 3:13 am
- Location: 90-61-92 // EU or ASIA
- Contact:
Re: PureTelegram (framework for using the Telegram API)
Nice one!
I have some questions:
- has it support proxy (http, or socks) connection?
- is it multi OS?
Thanks.
I have some questions:
- has it support proxy (http, or socks) connection?
- is it multi OS?
Thanks.
Re: PureTelegram (framework for using the Telegram API)
Since only 'normal' PB HTTP stuff is used, it should be work on all platforms.
If you need a proxy, you have to use
At the beginning of your code.
If you need a proxy, you have to use
Code: Select all
HTTPProxy()
-
- Addict
- Posts: 1233
- Joined: Wed Feb 28, 2007 9:13 am
- Location: London
Re: PureTelegram (framework for using the Telegram API)
This is a radical update of the library, with many changes. Code that uses the library will almost certainly have to be adjusted. For this reason, I have kept a legacy version of the library available (link in OP).
I have overhauled how the GetUpdates system works. It should be simpler to use now, and also more reliable.
There are a lot of new functions.
Most importantly, there is now a help file with a quickstart guide and many code examples, showing how to use each command. I hope this will encourage more people to get up and running with Telegram/PB work.
Full change log:
I have overhauled how the GetUpdates system works. It should be simpler to use now, and also more reliable.
There are a lot of new functions.
Most importantly, there is now a help file with a quickstart guide and many code examples, showing how to use each command. I hope this will encourage more people to get up and running with Telegram/PB work.
Full change log:
BUTTONS
Renamed: AddTelegramButton() -> Telegram_AddButton()
Renamed: NewTelegramButtonRow() -> Telegram_NewButtonRow()
POSTING MESSAGES
Renamed: PostMultiplePBImages -> PostAlbumOfPBImages()
Changed: input parameters for PostPBImage()
Changed: input parameters for PostOnlineImage()
Fixed: PostOnlineImage()
Fixed: "protect_content" variable wasn't being correctly handled
Added: "protect_content" variable to PostAlbum(), PostLocation(), PostVenue(), PostContact() and PostPoll()
Changed: PostPoll() can no longer post quizzes
Added: PostQuiz()
EDITING MESSAGES
Added: ReplaceMessageMedia()
Added: ReplaceMessageImageWithPBImage()
CHATS
Added: SetChatDefaultPermissions()
Added: SetChatDefaultPermissionsMap()
Added: SetChatAdministratorPermissionsMap()
Added: SetChatAdministratorCustomTitle()
Added: LeaveChat()
UPDATES
Removed: MyTG\update() list. See NextTelegramUpdate() for how to handle updates now
Changed: InstantiateBot() now requires a folder, not a txt file
Added: NextTelegramUpdate()
Added: DeleteUpdate()
Added: ClearUpdates()
Added: new update types: #TU_Type_MessageWasPinned, #TU_Type_MessageAutoDeleteChange, #TU_Type_Invoice, #TU_Type_SuccessfulPayment and #TU_Type_ProximityAlertTriggered
INVITE LINKS
Added: CreateChatPrimaryInviteLink()
MISC.
Changed: message type constants have been shortened, eg. #Telegram_MessageType_Audio -> #TG_MessageType_Audio
Added: SendStatus()
Added: HTML help file
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
-
- Addict
- Posts: 1233
- Joined: Wed Feb 28, 2007 9:13 am
- Location: London
Re: PureTelegram (framework for using the Telegram API)
Another update, this one focusing on commerce. I also added a few procedures that accidentally weren't included in the previous version.
The commerce functions have been fully tested.
The commerce functions have been fully tested.
I also made a start on InlineMode stuff, but it is so mindbogglingly complicated that I don't think I will pursue it.BOTS
Added: MakeScope()
Added: AddBotCommand()
Added: SetBotCommandsForScope()
Added: GetBotCommandsForScope()
Added: DeleteBotCommandsForScope()
COMMERCE
Added: AddInvoiceItem()
Added: PostInvoice()
Added: message type: TG_MessageType_Invoice
Added: AddShippingOption()
Added: AnswerShippingQuery()
Added: AcceptPayment()
Added: DeclinePayment()
WEBHOOKS
Added: SetWebhook()
Added: GetWebhookInfo()
Added: DeleteWebhook()
STICKERS
CreateNewStickerSet(), AddStickerToSet() and UploadStickerFile() now check the file size before uploading
MISC.
Changed: SendStatus() -> SendBotStatus()
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
Re: PureTelegram (framework for using the Telegram API)
I'm sorry to hear thatSeymour Clufley wrote: ↑Mon Feb 14, 2022 12:22 am I also made a start on InlineMode stuff, but it is so mindbogglingly complicated that I don't think I will pursue it.
Thanks anyway by all the nice work.
-
- Addict
- Posts: 1233
- Joined: Wed Feb 28, 2007 9:13 am
- Location: London
Re: PureTelegram (framework for using the Telegram API)
A new version:
Also, I've begun adding things that Telegram have brought in with the v6.0 API update, but this work is not complete.Added: DownloadChatAvatar()
Added: DownloadChatAvatarToPBImage()
Changed: DownloadUserProfilePhotosToMemory() -> DownloadUserAvatarsToPBImages()
Changed: DownloadUserProfilePhotos() -> DownloadUserAvatars()
Changed: DownloadUserCurrentProfilePhoto() -> DownloadUserCurrentAvatar()
Changed: removed the word "structure" from the end of all structure names
Fixed: a few bugs with the GetNewUpdates() system
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
Re: PureTelegram (framework for using the Telegram API)
Thanks for the updates
-
- Addict
- Posts: 1233
- Joined: Wed Feb 28, 2007 9:13 am
- Location: London
Re: PureTelegram (framework for using the Telegram API)
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
Re: PureTelegram (framework for using the Telegram API)
Handy!
Couple of points;
Can I ask why are you saving all requests to disk before processing them, also you might want to hide your personal bot API key in the example code
Couple of points;
Can I ask why are you saving all requests to disk before processing them, also you might want to hide your personal bot API key in the example code
-
- Addict
- Posts: 1233
- Joined: Wed Feb 28, 2007 9:13 am
- Location: London
Re: PureTelegram (framework for using the Telegram API)
If you mean the updates from Telegram get saved to file... Telegram will only send an update once. If your code crashes before/during processing that update, it won't be able to request it again. Therefore, I thought it was best to save all updates to file before beginning to process them.
My own bot API key isn't in any of the example code, I'm pretty sure.
My own bot API key isn't in any of the example code, I'm pretty sure.
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
Re: PureTelegram (framework for using the Telegram API)
That's fairSeymour Clufley wrote: ↑Thu May 12, 2022 3:44 am If you mean the updates from Telegram get saved to file... Telegram will only send an update once. If your code crashes before/during processing that update, it won't be able to request it again. Therefore, I thought it was best to save all updates to file before beginning to process them.
An API token is exposed in a couple of snippets;Seymour Clufley wrote: ↑Thu May 12, 2022 3:44 am My own bot API key isn't in any of the example code, I'm pretty sure.
https://www.purebasic.fr/english/viewto ... 64#p576464
https://www.purebasic.fr/english/viewto ... 41#p576741
https://www.purebasic.fr/english/viewto ... 81#p576781
-
- Addict
- Posts: 1233
- Joined: Wed Feb 28, 2007 9:13 am
- Location: London
Re: PureTelegram (framework for using the Telegram API)
Ah yes, that's a bot key that I just made up, for demo purposes.
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
Re: PureTelegram (framework for using the Telegram API)
Hi Seymour,
I didn't have time to try it, yet and also I didn't have a real reason to use it, but I just wanted to tell you that this Include is very impressive!
I didn't have time to try it, yet and also I didn't have a real reason to use it, but I just wanted to tell you that this Include is very impressive!
PureBasic 6.04/XProfan X4a/Embarcadero RAD Studio 11/Perl 5.2/Python 3.10
Windows 11/Ryzen 5800X/32GB RAM/Radeon 7770 OC/3TB SSD/11TB HDD
Synology DS1821+/36GB RAM/130TB
Synology DS920+/20GB RAM/54TB
Synology DS916+ii/8GB RAM/12TB
Windows 11/Ryzen 5800X/32GB RAM/Radeon 7770 OC/3TB SSD/11TB HDD
Synology DS1821+/36GB RAM/130TB
Synology DS920+/20GB RAM/54TB
Synology DS916+ii/8GB RAM/12TB
-
- Addict
- Posts: 1233
- Joined: Wed Feb 28, 2007 9:13 am
- Location: London
Re: PureTelegram (framework for using the Telegram API)
Thank you.
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
Re: PureTelegram (framework for using the Telegram API)
Hello. Thanks for your great work.
Can a bot use this API to communicate with the user in a dialogue?
without public chat.
I didn't find how to do it.
Can a bot use this API to communicate with the user in a dialogue?
without public chat.
I didn't find how to do it.