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
PTB provides an +error_handler+ that you can use to send message if you want !search
Читать полностью…
One exists, the second one is a joke, sorry! - Use the first one!
Читать полностью…
That's why we have job_queue.run_repeating_perhaps()
Jup. Randomly stopping it would be a funny idea
Читать полностью…
Just confirming, job_queue.run_repeating runs it indefinitely?
using https://github.com/python-telegram-bot/python-telegram-bot/wiki/Extensions---JobQueue?
Читать полностью…
https://github.com/python-telegram-bot/python-telegram-bot/network/dependents?dependents
Читать полностью…
Ignore that its here https://github.com/python-telegram-bot/python-telegram-bot/wiki/Bots-built-with-PTB
Читать полностью…
Hello everyone!
can anyone please help, with this error TypeError: Updater.init() got an unexpected keyword argument 'use_context'
I tried remove (use_context=True) and I got another error TypeError: Updater.init() missing 1 required positional argument: 'update_queue'
I think thats comparable to the jupyter notebook issue where the "IDE" already launches a loop.
Читать полностью…
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
File ~\anaconda3\lib\site-packages\telegram\ext\_application.py:1036, in Application.__run(self, updater_coroutine, stop_signals, close_loop)
1035 updater_coroutine.close()
-> 1036 raise exc
1037 finally:
1038 # We arrive here either by catching the exceptions above or if the loop gets stopped
File ~\anaconda3\lib\site-packages\telegram\ext\_application.py:1025, in Application.__run(self, updater_coroutine, stop_signals, close_loop)
1024 try:
-> 1025 loop.run_until_complete(self.initialize())
1026 if self.post_init:
File ~\anaconda3\lib\asyncio\base_events.py:623, in BaseEventLoop.run_until_complete(self, future)
622 self._check_closed()
--> 623 self._check_running()
625 new_task = not futures.isfuture(future)
File ~\anaconda3\lib\asyncio\base_events.py:583, in BaseEventLoop._check_running(self)
582 if self.is_running():
--> 583 raise RuntimeError('This event loop is already running')
584 if events._get_running_loop() is not None:
RuntimeError: This event loop is already running
During handling of the above exception, another exception occurred:
RuntimeError Traceback (most recent call last)
File ~\anaconda3\lib\site-packages\telegram\ext\_application.py:1047, in Application.__run(self, updater_coroutine, stop_signals, close_loop)
1046 loop.run_until_complete(self.post_stop(self))
-> 1047 loop.run_until_complete(self.shutdown())
1048 if self.post_shutdown:
File ~\anaconda3\lib\asyncio\base_events.py:623, in BaseEventLoop.run_until_complete(self, future)
622 self._check_closed()
--> 623 self._check_running()
625 new_task = not futures.isfuture(future)
File ~\anaconda3\lib\asyncio\base_events.py:583, in BaseEventLoop._check_running(self)
582 if self.is_running():
--> 583 raise RuntimeError('This event loop is already running')
584 if events._get_running_loop() is not None:
RuntimeError: This event loop is already running
During handling of the above exception, another exception occurred:
RuntimeError Traceback (most recent call last)
Input In [18], in <cell line: 733>()
731 application.run_polling(allowed_updates=Update.ALL_TYPES)
733 if name == '__main__':
--> 734 main()
Input In [18], in main()
728 application.add_handler(MessageHandler(filters.TEXT & (~filters.COMMAND), relay_message))
729 application.add_handler(CommandHandler('code', code))
--> 731 application.run_polling(allowed_updates=Update.ALL_TYPES)
File ~\anaconda3\lib\site-packages\telegram\ext\_application.py:836, in Application.run_polling(self, poll_interval, timeout, bootstrap_retries, read_timeout, write_timeout, connect_timeout, pool_timeout, allowed_updates, drop_pending_updates, close_loop, stop_signals)
833 def error_callback(exc: TelegramError) -> None:
834 self.create_task(self.process_error(error=exc, update=None))
--> 836 return self.__run(
837 updater_coroutine=self.updater.start_polling(
838 poll_interval=poll_interval,
839 timeout=timeout,
840 bootstrap_retries=bootstrap_retries,
841 read_timeout=read_timeout,
842 write_timeout=write_timeout,
843 connect_timeout=connect_timeout,
844 pool_timeout=pool_timeout,
845 allowed_updates=allowed_updates,
846 drop_pending_updates=drop_pending_updates,
847 error_callback=error_callback, # if there is an error in fetching updates
848 ),
849 close_loop=close_loop,
850 stop_signals=stop_signals,
851 )
File ~\anaconda3\lib\site-packages\telegram\ext\_application.py:1052, in Application.__run(self, updater_coroutine, stop_signals, close_loop)
1050 finally:
1051 if close_loop:
-> 1052 loop.close()
File
Examples directory of python-telegram-bot:
errorhandlerbot.py
Uhm. You don't need to use tasks or job queues for that though
Читать полностью…
English only here, and these groups are not for job offers, use different ones or websites
Читать полностью…
Thanks, I needed the ptb error handling to send me a DM on errors, which was tricky with running an asyncio.create_task
The callbacks you pass must be function names, not None :)
Читать полностью…
hello everyone. i would like to make a bot for the store on my own. and im looking for a tutor who would teach me, and with his help i would do it. i will be glad to receive feedback from russia or belarus, because i will be able to pay. thanks to the community!
всем привет. хотелось бы самостоятельно сделать бот для магазина. и я ищу репетитора, который бы научил меня, и с его помощью бы его сделала. буду рада отзывам из россии или белоруссии, потому что смогу платить. спасибо сообществу!
How to install python telegram bot for concurrent updates
Читать полностью…
Wiki Category Code Snippets: Build a menu with Buttons
Читать полностью…
Anyone has Python telegram bot (new version) open source code?
Читать полностью…
No error handlers are registered, logging exception.
Traceback (most recent call last):
File "/app/.heroku/python/lib/python3.12/site-packages/telegram/ext/_application.py", line 1264, in process_update
await coroutine
File "/app/.heroku/python/lib/python3.12/site-packages/telegram/ext/_handlers/basehandler.py", line 157, in handle_update
return await self.callback(update, context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: object NoneType can't be used in 'await' expression
Hey. Please show the full traceback via a pastebin. Make sure to include everything from the first Traceback (most recent call last): until the last error message. https://pastebin.com/ is a popular pastebin service, but there are many alternatives out there.
Remove and readd the bot if you change privacy setting while it is in the group
Читать полностью…