Guys I'm used this typing($chat_id, $action = 'typing') sleep(2); Then send a message,

but sleep(); will stop the bot completely for all users how can fix it?
I want some time to show action

58 ответов

9 просмотров

use multithreading or multiprocessing in php

sleep() doesn't stop the script, maybe your code (sendMessage) has an error

Will
sleep() doesn't stop the script, maybe your code (...

if the script is single threaded, it'll stop the processing :)

Will
sleep() doesn't stop the script, maybe your code (...

No, it stops because Telegram sends the updates one by one And it will not send the next update until it receives a response of 200

M A
No, it stops because Telegram sends the updates on...

incorrect. default max connections is 40. If one thread is sleeping, there are still 39 other threads.

M A
No, it stops because Telegram sends the updates on...

There bot is sending a msg, it can send anytime

Para TFF
incorrect. default max connections is 40. If one...

No bro, the max connection is a different parameter

Para TFF
incorrect. default max connections is 40. If one...

if not using webhooks (getUpdates), then it receives 100 at a time. It's not 1 by 1

Will
There bot is sending a msg, it can send anytime

Yes ‌But I'm talking about the webhook script to which updates are sent and the bot handles .

ッ Marshmallow 🎀 ❦ ᵐⁱˢˢ Σ ᶜᵒˡˡᵉᵍⁱᵃⁿ ᵃⁿᵈ ᵍᵃᵐᵉʳ 👱🏻‍♀ 🦋²⁰²²ᵗʰ 🎀 🧞‍♀️×͜×
Is there an easier way than that site?

Test this script on the server and then tell the result <?php if (is_callable('fastcgi_finish_request')){ echo "fastcgi_finish_request"; }elseif(is_callable('litespeed_finish_request')) { echo "litespeed_finish_request"; }else{ echo "Not support"; }

ッ Marshmallow 🎀 ❦ ᵐⁱˢˢ Σ ᶜᵒˡˡᵉᵍⁱᵃⁿ ᵃⁿᵈ ᵍᵃᵐᵉʳ 👱🏻‍♀ 🦋²⁰²²ᵗʰ 🎀 🧞‍♀️×͜×
I put it the main file

no, make a new file not the main bot script first we need check what functions are callable on your server, the use them in main script

I once created a bot with multiple php scripts running in parallel. I used passthru() to spawn a bash script, which spawned another php script in parrallel. I really don't recommend it, but it's a way if your php doesn't support multiple threads.

In sceipt first call file use fastcgi_finish_request();

Quad
I once created a bot with multiple php scripts run...

My file perfect now i have only some issues the worse one sleep(); Because i use it alot for add some time to show action

ッ Marshmallow 🎀 ❦ ᵐⁱˢˢ Σ ᶜᵒˡˡᵉᵍⁱᵃⁿ ᵃⁿᵈ ᵍᵃᵐᵉʳ 👱🏻‍♀ 🦋²⁰²²ᵗʰ 🎀 🧞‍♀️×͜×
screenshot No else black screen

U aren't running this script Because in the worst case, it should print "Not support" message https://t.me/BotTalk/625723

Yes put the codes in new file, but don't set webhook You need open it in ur browser

M A
Yes put the codes in new file, but don't set webho...

Can't open file on heroku by browser always black screen no any info And bot works fine without error log 🥲

wym

M A
wym

You want from me open the file link in browser after running it on heroku But i always got black screen without any info

ッ Marshmallow 🎀 ❦ ᵐⁱˢˢ Σ ᶜᵒˡˡᵉᵍⁱᵃⁿ ᵃⁿᵈ ᵍᵃᵐᵉʳ 👱🏻‍♀ 🦋²⁰²²ᵗʰ 🎀 🧞‍♀️×͜×
You want from me open the file link in browser aft...

Put this code in the script of the bot if (is_callable('fastcgi_finish_request')){ echo "fastcgi_finish_request"; session_write_close(); fastcgi_finish_request (); }elseif(is_callable('litespeed_finish_request')) { echo "litespeed_finish_request"; session_write_close(); litespeed_finish_request(); }else{ echo "Not support"; } then check the sleep problem solved or not

M A
Put this code in the script of the bot if (is_cal...

Let me got it I only put this file in new php file called name.php without incline "name.php"; in main file And running on heroku?

M A
No bro, the max connection is a different paramete...

Hello, good morning, I say if you do not bother, remind me how to make a tambourine robot and tame it.

M A
No, it stops because Telegram sends the updates on...

This right exactly happens to my bot After reply to my command have sleep 10 seconds No any reply to other commands before 10 seconds

Похожие вопросы

Обсуждают сегодня

Кстати @darkhole1 для rich telegram app с поддержкой транзакций p2p через ton - какой язык считается с самой хорошей поддержкой?
Serg Gini
3
Эх кто-то пришел и весь праздник испортил :( You need complex FBX scene importing setup to change things on import? good luck with that. You need navigation and pathfinding? g...
Serg Gini
5
есть спецы по гитлабу? нужно решить проблему того, что гитлаб не показывает файлы с расширением txt в артефактах и предлагает их скачать и смотреть локально. а это неудобно. в...
Aleksandr Druzhinin
1
Здравствуйте. Есть спецы на языке D ? Есть проект (торговый бот) нужна долгосрочная поддержка на материальной основе) (достойная оплата) Подробности в лс.
6h123 6h123
1
как работают все эти прокси онлайн, где ты можешь ввести сайт и он зайдет на сайт от своего имени?
Aleksandr Druzhinin
1
День добрый. Стандартная библиотека phobos (std.array) ссылается на внешнюю фунцию _d_newarrayUTrace и при сборке с ключом profile-gc эта ссылка остаётся неопределённой. Никак...
slacker linuxoid
5
на D можно построить абсолютно разный архитект, как объектный, так и нет, оч широкий простор для принятия решений. Однако проблема в том, что большинство книг об айтишной архи...
Constantin_FV
1
Доброго времени суток. Сейчас я работаю над своей архитектурой Component / Systems. Если просто, это то что использовали до дробления на ECS. Потому что ECS это все таки нишев...
Vi
26
Для меня наследование это просто удобство ради удобства. Без множественного наследования, это бесполезная вещь, но удобная. С множественным наследованием, это опасная, но мощн...
Vi
1
string xczhojoxueaflfhhygcc ="xczhojoxueaflfhhygcc"; long xczhojoxueaflfhhygcc_2 =1368962155; import std.conv: text; writeln(text(xczhojoxueaflfhhygcc, " ", xczhojoxueaflfhhyg...
Constantin_FV
6
Карта сайта