Closed mjavidm closed 7 years ago
how to set ssl certificate in webhook ?
I'm still using the CloudFlare DNS for my bot, so all of my next advices are untested. If your server is correctly configured, you should be able to upload the cert file in the same folder of your bot script and run; $telegram->setWebhook("url", cert);
tnk u but if send pm to all member (1K member ) of bot CloudFlare give an eror 524
put a timeot beetween the pm send
How?
You need something like this:
$SECONDS_TO_WAIT = 10;
$USER_AT_ONCE = 10;
foreach ($users as &$user) {
$i = 0;
//Send Message
$telegram->sendMessage(....);
// Wait $SECONDS_TO_WAIT after every $USERS_AT_ONCE
$i++;
if ($i > $USERS_AT_ONCE) {
$i = 0;
sleep($SECONDS_TO_WAIT);
}
}
Change the value of $SECONDS_TO_WAIT and $USER_AT_ONCE until you find the right combination
This shoul take care of the timeout on the Telegram's front. For the CloudFlare read this; https://support.cloudflare.com/hc/en-us/articles/200171926-Error-524-A-timeout-occurred
"If you regularly run HTTP requests that take over 100 seconds to complete (for example large data exports), one alternative is to move those long-running processes to a subdomain that is not proxied by Cloudflare. That subdomain would have the orange cloud icon toggled to grey in the Cloudflare DNS Settings. "
hi, im using ssl from cloudflare when using as Dedicated IP and private ssl certificate bot not work please help me