Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Plugin_Threads extends Plugin {
- public $triggers = array('!threadz');
- function isTriggered() {
- if(!isset($this->data['text'])) {
- $this->reply('Some data plox');
- return;
- }
- $this->reply("Ok, I'm doing your super long lasting command with input '".$this->data['text']."' now. I'll report back when it's finished.");
- $this->addJob($this->data['text']);
- }
- function onJobDone() {
- $this->reply('Good news everyone, I processed '.$this->User->nick.'\'s input as fast as I could and here is the result: '.$this->data['result']);
- }
- function doJob($data) {
- sleep(10);
- return strrev($data);
- }
- }
- ?>
Add Comment
Please, Sign In to add comment