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
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.
anyio 4.2.0
APScheduler 3.6.3
cachetools 4.2.2
certifi 2023.11.17
charset-normalizer 3.3.2
h11 0.14.0
httpcore 1.0.2
httpx 0.25.2
idna 3.6
pip 23.3.2
python-dotenv 1.0.0
python-telegram-bot 13.7
pytz 2023.3.post1
requests 2.31.0
setuptools 69.0.3
six 1.16.0
sniffio 1.3.0
tornado 6.4
tzdata 2023.4
tzlocal 5.2
urllib3 2.1.0
File "D:\PythonProjects\Telegram ChatBot\main.py", line 5, in <module>
from telegram.ext import (
File "D:\PythonProjects\Telegram ChatBot\env\Lib\site-packages\telegram\__init__.py", line 174, in <module>
from .bot import Bot
File "D:\PythonProjects\Telegram ChatBot\env\Lib\site-packages\telegram\bot.py", line 103, in <module>
from telegram.utils.request import Request
File "D:\PythonProjects\Telegram ChatBot\env\Lib\site-packages\telegram\utils\request.py", line 44, in <module>
import urllib3.contrib.appengine as appengine # type: ignore[no-redef]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'urllib3.contrib.appengine'
(env) D:\PythonProjects\Telegram ChatBot>
Hi guys, Can I add a placeholder to the message writing section?
If possible can you direct me to the correct document? Thank you.
def main():Читать полностью…
my_timezone = pytz.timezone('Europe/Rome')
application = Application.builder().token(variables.bot_token).defaults(Defaults(tzinfo=my_timezone)).build()
application.add_handler(CommandHandler("start", start))
application.add_handler(CallbackQueryHandler(execute))
application.run_polling()
if __name__ == "__main__":
check_files()
load_whitelist_from_file()
main()
Wiki Category Design Pattern: Running PTB alongside other asyncio frameworks
Читать полностью…
That's what I can't understand :(
If me try like this start()
await asyncio.Future() # endless wait
stop()
Bot started but Didn't take any cmd
Likeasyncio.get_event_loop().run_until_complete(main()) ?
you call stop() directly after calling start() … you'll have to keep the hevent loop running until you want to shut down the bot
telegram.Bot.send_message(..., message_thread_id=...)
python-telegram-bot documentation for this parameter of telegram.Bot.send_message:
message_thread_id
ReplyKeyboardMarkup.input_field_placeholder
python-telegram-bot documentation for this attribute:
telegram.ReplyKeyboardMarkup.input_field_placeholder
Telegram's official Bot API documentation has more info about ReplyKeyboardMarkup.
these are the requirements that I have installed
Читать полностью…
Forgot to
sudo systemctl enable my-service
I have one more bot and Im using the same files and service in linux to booting the bot and this one start the other one no :(
Читать полностью…
Getting this error when rebooting my server and trying to boot the service for my python bot:
RuntimeError event loop is closed
there are a lot of different options to achieve this and which one you pick depends on your use case. Note that this is not a ptb-specific problem but a rather generic python question. there are also some notes on this in +running alongside+ iirc !search
Читать полностью…
Wiki of python-telegram-bot - Category Notable Features
Bot API Forward Compatiblity
that wouldn't make any difference, I guess. The point is that between start and stop ye need something that prevents python from directly jumping to stop().
telegram api 7.0 how much left to release with this ptb library send the link
Читать полностью…
https://pastebin.com/0mZLtAxb
1st one work perfect .
2 nd : bot stopped with in a sec.
What's wrong ?
How do I send a message to a telegram topic
Читать полностью…