10206
This group is for questions, answers and discussions around the python-telegram-bot library. Off-topic group: @pythontelegrambottalk | Website: https://python-telegram-bot.org
I'm testing it but i think it works like a filter and all of updates are allowed even without using it (i guess)
Читать полностью…
https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-20.0
need to update your code too
Tutorial: Your first bot
from telegram import Update
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, CallbackContext
# Replace 'YOUR_BOT_TOKEN' with your actual bot token
TOKEN = 'YOUR_BOT_TOKEN'
def start(update: Update, context: CallbackContext) -> None:
user_name = update.message.from_user.first_name
update.message.reply_text(f"Hello {user_name}! Welcome to your bot.")
def main() -> None:
updater = Updater(token=TOKEN, use_context=True)
dp = updater.dispatcher
dp.add_handler(CommandHandler("start", start))
updater.start_polling()
updater.idle()
if name == 'main':
main()
Im getting 'cannot import update from telegram' how to fix this?
Isn't there a problem with ChatJoinRequestHandler?
It doesn't even detect the request
does nothing
Bot.send_dice
python-telegram-bot documentation for this method:
telegram.Bot.send_dice
Telegram's official Bot API documentation has more info about sendDice.
same lol, so many things have changed since then
Читать полностью…
Check the transition guide/changelog and update your code accordingly.
Читать полностью…
Hello there, Feinstes Cali 🍁🍀 dry sift 🍫. You are writing your job offer in our technical focused groups, which is against our rules. To find a bot developer, please look at agencies dedicated towards freelancers. An example of those would be https://fiverr.com, which we are not associated with.
Читать полностью…
Hey. Please post code or tracebacks using a pastebin rather than via plain text or a picture. https://pastebin.com/ is quite popular, but there are many alternatives out there. Of course, for very short snippets, text is fine. Please at least format it as monospace in that case.
Читать полностью…
Yeah then you would need to change your code accordingly
Читать полностью…
Hey. You seem to be using the new version (>=20.0) of python-telegram-bot but your code is written for an older and deprecated version (<=13.15).
Please update your code to the new v20 by reading the release notes and the transition guide linked below.
You can also install a version of PTB that is compatible with your code base, but please note that the library has undergone significant changes in v20 and the older version is not supported anymore. It may contain bugs that will not be fixed by the PTB team and it also doesn't support new functions added by newer Bot API releases.
It just get deleted now 😐
a new one: https://nekobin.com/lezuseziri.py
Hey. You seem to be using a version <=13.15 of python-telegram-bot. Please note that we only provide support for the latest stable version and that the library has undergone significant changes in v20. Please consider upgrading to v20 by reading the release notes and the transition guide linked below.
My code: https://nekobin.com/jigokepeso.py
Читать полностью…
Not sure where in the docs you read that it cuts it off, it is a meta information for telegram
Читать полностью…
how to send that game emoji using bot?
i want to send that slot machine emoji
i am sending 🎰 this , but it's not working as game
I honestly think it's already broken in some ways
Читать полностью…
you can use that version, just install that version of PTB. Note that it is unmaintained and might break in future
Читать полностью…
I didnt understood in that thats why I ask for help
Читать полностью…
I just pointed you to a resource in the wiki, the docs or the examples and I have the strong feeling that you did not actually read it. Please do so. If you don't understand everything and have follow up questions, that's fine, but you can't expect me to repeat everything just for you because you didn't feel like reading on your own. 😉
Читать полностью…
Hey. You seem to be using the new version (>=20.0) of python-telegram-bot but your code is written for an older and deprecated version (<=13.15).
Please update your code to the new v20 by reading the release notes and the transition guide linked below.
You can also install a version of PTB that is compatible with your code base, but please note that the library has undergone significant changes in v20 and the older version is not supported anymore. It may contain bugs that will not be fixed by the PTB team and it also doesn't support new functions added by newer Bot API releases.
def main():
updater = Updater(TOKEN, use_context=True)
dp = updater.dispatcher
# Add your handlers here
dp.add_handler(CommandHandler('start', start))
conv_handler_login = ConversationHandler(
entry_points=[CommandHandler("login", login_message)],
states={
REGISTER_PHONE: [MessageHandler(filters.text & ~filters.command, referal_code)],
REFERAL_CODE: [MessageHandler(filters.text & ~filters.command, confirm_age)],
CONFIRM_AGE: [CallbackQueryHandler(confirm_age_callback)],
WAITING_FOR_OTP: [MessageHandler(filters.text & ~filters.command, waiting_for_otp)],
},
fallbacks=[CommandHandler("back", back)],
allow_reentry=True,
)
# Add the ConversationHandler to your dispatcher
dp.add_handler(conv_handler_login)
dp.add_handler(CallbackQueryHandler(resend_otp_callback, pattern='resend_otp'))
updater.start_polling()
updater.idle()
Traceback (most recent call last):
File "D:\PythonProjects\Telegram ChatBot\main.py", line 51, in <module>
main()
File "D:\PythonProjects\Telegram ChatBot\main.py", line 24, in main
updater = Updater(TOKEN, use_context=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Updater.init() got an unexpected keyword argument 'use_context'
I even tried by using latest version i.e 20.7
Читать полностью…