Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (strlen($content) > 1800) {
- $messageSplit[1] = htmlspecialchars_decode(trim($messageSplit[1]));
- $channel->sendMessage($messageSplit[1], false)->then(
- function (){ //code on completion
- unset($messageSplit[0]);
- unset($messageSplit[1]);
- array_values($messageSplit);
- SendQueued($channel, $messageSplit);
- },
- function ($reason){
- //process exception
- }
- );
- if (DEBUG) { $this->logger->addInfo("Debug MSG:009-0-2 fCheckMails_for{$keyID}-msg2: {$messageSplit[1]}"); }
- }
- //add function somewhere
- /**
- * Sends messages in queue waiting for previous to send (hopefully x) )
- * @param $channel channel to send to
- * @param $msg message text
- */
- function SendQueued($channel, $msg){
- $channel->sendMessage($msg[0])->then(
- function (){ //code on completion
- unset($msg[0]);
- array_values($msg);
- if(count($messageSplit)>0) return SendQueued($channel, $messageSplit);
- },
- function ($reason){
- //process exception
- }
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement