如果您喜歡該視頻,請務必評論,頂和訂閱。如果您有任何疑問,請將其保留在評論中,我會儘快檢查您。任何建議和/或建設性的批評表示讚賞。
鏈接到官方的Telegram Bot API:https://core.telegram.org/bots/api
鏈接到pyTelegramBotAPI存儲庫:https://github.com/eternnoir/pyTelegramBotAPI
至於我選擇的編輯器,我更喜歡使用完全可定製的開源Atom。鏈接:https://atom.io
在pyTelegramBotAPI中,使用裝飾器函數訪問消息處理程序。如果您不知道這些是什麼,可以看以下一些內容:
代碼船的「 Python裝飾器指南」-https://www.thecodeship.com/patterns/guide-to-python-function-decorators/
Corey Schafer撰寫的「 Python教程:裝飾器」-https://www.youtube.com/watch?v=FsAPt_9Bf3U
我還談到電報如何每小時左右關閉連接,所以這是Github問題:https://github.com/eternnoir/pyTelegramBotAPI/issues/251#issuecomment-278531560
如果您對Lambda函數有困難,可以快速閱讀以下文章:https://pythonconquerstheuniverse.wordpress.com/2011/08/29/lambda_tutorial/
您可以在哪裡免費託管您的機器人(請不要將其用於測試以外的目的):https://pythonanywhere.com
我還聽說您可以在Heroku上託管該機器人,但我個人無法做到這一點。如果您想在實際伺服器上託管該機器人,我建議Scaleway的Starter X86-64價格為2.99英鎊。
如果您需要機器人的代碼,請立即使用它,它是開源的,可以在https://github.com/karipov/atlink上找到。
感謝收看! 。
can u say how to install the pip in command prompt for telebot i got error in pip installation please help me
Excellent explanation, thank you so much!
Make a video on how to use force_reply sir. Examples: 1. Bot Ask: Purchase Amount: 2. User Response: (Purchase Input) 3. Then Bot Response: You buy so much (Specifies the purchase amount that a user inputs) how to pack
Very useful. Many thanks.
Hi
i have some errorse like this
what is my problem?
telegram.error.NetworkError: urllib3 HTTPError HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /bot1131814295:AAG0I7s0n0xu8InJqQLf4hSZeTDlZIEmkHk/getMe (Caused by ConnectTimeoutError(<telegram.vendor.ptb_urllib3.urllib3.connection.VerifiedHTTPSConnection object at 0x000002769B6DF7F0>, 'Connection to api.telegram.org timed out. (connect timeout=5.0)'))
I'm in iran and telegram is filtered by government 🙁
how can I solve my problem?
I can't download pyTelegramBotAPI. Why?
Nice tutorial! thanks
how to add a button
@Tech Mind
First of all, thank you for this tutorial. The best so far.
Could you continue this kind of tutorials related to pyTelegramBotAPI?!
Ты узбек!) И тебя зовут Камрон. И кст спасибо за урок
great video man! Do you know to make a bot which sends likes on instagram to the link list ?
How can i set a auto welcome message and group rules to new joining members to the group. I saw many videos in Youtube with bots (the bot which are created by others), Is there any simply way to set a welcome messages with group rules with a Facebook link with OWN BOT i mean the bot we created.
I'll try and give a feedback later but it looks awesome.
Hi Komron, could you please kindly explain how inline buttons in telebot work?
P.S. My name is Komron too. LoL
Dude, i hope you are fine. Your tutorials are the best thing! Don't stop doing them!!!
thanks, how to send large file, link more then 50mb, with telebot api?
one of the best tutorials thank you so much
Good luck!
tnx! Where new video?
Is the 15s sleep time replaceable with shorter times to make it faster?
What if I want language testing with it. like if I want Chinese searching enabled? what do I have to do?
хешхо?
Hey man I'm wondering if I can acces get_updates as json file? Anytime I assign a variable to that function it gives me a list with telebot objects in it.
Thanks!
How can I import a database and display the items in it when using a command
and what database do you recommend using
Очередной студент веста)
Спасибо, очень хорошо объясняешь.
i have follow your instruction, but when i send a chat to my bot, the bot never answer it.
Please tell me if there any something to do before or after write your code, please
import telebot
import time
bot_token = 'MyToken'
bot = telebot.TeleBot(bot_token)
@bot.message_handler(commands=['help', 'start'])
def send_welcome(message):
bot.reply_to(message, "Welcome in Chat Bot !")
print('Ok No Error');
windows powershell link?
Very good howto for the beginners, like.
A little remark on str.format() method.
You may consider using f-strings for that purpose, it's more readable, check the line 26, timecode 12:33
bot.reply_to(message, f"https://instagram.com/{at_text[1:]}")
And a question.
Could you be more precise on the exception we need to catch? What type of exception is this?
thank you
Please do more Python telegram bot tutorials, nobody else explains it as well as you!
it's giving me an error Traceback (most recent call last):
File "bot.py", line 6, in <module>
bot = telebot.TeleBot(token=TOKEN)
TypeError: __init__() got an unexpected keyword argument 'token'
where should we upload the codes?