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
How this part i cannot write this send message in the same UpdateHandler Functions?
i really not get the idea how i will send a response to the user back maybe i am doing video cutting so i will use ffmpeg i am confused this, that my PTB handler function will download one big file and then i will call how i am confusd, what things are these?
To me, there is no need in some kind of specific ptb system, it is not really about the ptb field of responsibiliy. It is more about how two parts of your program communicate.
A user sends the file, the bot gets it, writes the user tg id to any database (better persistent one if file processing may take half an hour or so), and once the processing has been finished and your system receives a response from the processing script, the program fetches the user tg id from the database and sends to them a message via ptb.
that’s probably gonna happen. however devs are currently working on a major refactor, so we gonna need to wait
Читать полностью…
Hi! Do you plan to support ephemeral messages? Other libraries have already implemented this.
Читать полностью…
Have anybody think of jailbreaking Claude AI ?
Читать полностью…
I also encountered this "problem phenomenon" before. The same also happened to me: at first, it gave me that "Timed out" error, regardless this, it still successfully sent out. I don't know what's this error for. Maybe it's like a "warning" which makes you pay attention if the message/file really gets sent out or not. Although it seems that in most cases, it can still send out the message/file with no problem, I believe there are still cases where the message/file might "get lost" on their way (i.e. fail to get sent out).
see as you send builder = ... and then dot build() i found .build() will make the application obj not the builder obj, so i think your builder = .build() is not right is this ?
Читать полностью…
builder = ApplicationBuilder()
.token(token=BOT_TOKEN)
.post_init(notify_admin_on_startup).build()
async def notify_admin_on_startup(application: Application) -> None:
builder = (ApplicationBuilder()
.token(token=BOT_TOKEN)
.post_init(notify_admin_on_startup))
"export" = ?
You can use Termux and install any packages you need, Git included... Btw this is a bit off-topic here
Hi, does anyone know if I can create a bot from my mobile phone and how to export the code???
Читать полностью…
Are software asset listings permitted in a designated channel or thread?
Читать полностью…
i personally think that not only you gonna find it's easy to work with multiple files but you probably gonna need it to not make your mind blow.
now working with multiple files is more a general pyhton kwnoledge thing so i recommend you read some sources to learn how to do it, but in short terms recalling a file using import statements is enough until you need internal packages, altough even with packages you won't go far away from the import statement logic (you just gonna switch to from x import y statements)
You can put the commands in one function while the command's callback can be in anywhere else since what important is what the command should "call" when user sent this or that.
Читать полностью…
The download method is async, so you just await it and send the message after that
Читать полностью…
See When User send some file my bot download this and do some processing on it, maybe this processing take 30 second or 30 minute, but how i can say when this processing will finish after that only send a response to the user that it is done.
What system PTB has for this and some documentation or article on this?
as far as i know you need to define "receiver_user" when sending a message https://core.telegram.org/bots/api#message
Читать полностью…
I moved this discussion to the off-topic group.
Читать полностью…
Hey. You can find an explanation of @roolsbot's functionality on 'GitHub.
Читать полностью…
I got too surpirsed with a new thigns see, my bot which has conencted with local bot api server, ther i tried to send a large file 200 mb from the local storage to the user , but due to i connect to mobile hotspot this internet is too slow and after some time my terminal say this,
.venv/lib/python3.12/site-packages/telegram/request/_httpxrequest.py", line 296, in do_request
raise TimedOut from err
telegram.error.TimedOut: Timed out
no as after i make the builder as i shows here
then i next line did,
application = builder.build()Читать полностью…
Are you ending it with .build() after the post init call?
Читать полностью…
In normal function we pass context, update in the funciton, now i want to send a starutp message to admin at start of the bot so i found there is: post_init -> here what funciton i will pass and its args will what i am confused any article on this explaining how to use the callback function here?
Читать полностью…
https://onlinenotepad.org/notepad
save as .py upload to Google drive gg
Thank you very much!
Yes i've hoped to be able to split stuff up and have commands, at least bigger/complex ones, in its own files.
I'll read the article you've linked and will try my best from there!
is there any "official" guideline how to do that? Or do i "just" create additional python codefiles and use "import" in the right order to load them into the main bot file?
In the old PHP Based Library there was a dedicated Command folder where every command would have/need its own .php file, and i'm trying to figure out if PTB has something like this build in or not ^^'
obviously I recommend to split code responsibilities when the project starts to get more complex
Читать полностью…