Город МОСКОВСКИЙ
00:15:21

Python Telegram Bot with pyTelegramBotAPI

Аватар
Мастерим React: шаг за шагом
Просмотры:
35
Дата загрузки:
28.11.2023 08:35
Длительность:
00:15:21
Категория:
Технологии и интернет

Описание

If you liked the video, please be sure to comment, like and subscribe. In case you have any questions, leave them in the comments and I will check up on you as fast as I can. Any suggestions and/or constructive criticism are appreciated.

Link to the official Telegram Bot API: https://core.telegram.org/bots/api

Link to pyTelegramBotAPI repository: https://github.com/eternnoir/pyTelegramBotAPI

As to my editor of choice, I prefer using the fully customizable and open-source Atom. Link: https://atom.io

In pyTelegramBotAPI, message handlers are accessed using decorator functions. If you don't know what those are, here are some things you can look at:
"A guide to Python decorators" by The Code Ship - https://www.thecodeship.com/patterns/guide-to-python-function-decorators/
"Python Tutorial: Decorators" by Corey Schafer- https://www.youtube.com/watch?v=FsAPt_9Bf3U

I also talk about how telegram closes connections every hour or so, so here is the Github Issue: https://github.com/eternnoir/pyTelegramBotAPI/issues/251#issuecomment-278531560

Here is a quick article on lambda functions if you are having a hard time with them: https://pythonconquerstheuniverse.wordpress.com/2011/08/29/lambda_tutorial/

Where you can host your bot for free (please don't use it for purposes other than testing): https://pythonanywhere.com

I also hear you can host the bot on Heroku, but I haven't been able to personally do that. If you would want to host the bot on an actual server, I would recommend Scaleway's Starter X86-64 priced at £2.99.

If you need the code for the bot, please now that it's open-source and can be found at https://github.com/karipov/atlink

Thanks for watching!

Рекомендуемые видео