@@ -100,7 +100,7 @@ |
||
| 100 | 100 | { |
| 101 | 101 | if ($user !== null) { |
| 102 | 102 | $this->client->apiCall('im.open', ['user' => $user]) |
| 103 | - ->then(function (Payload $response) use ($messageToSent) { |
|
| 103 | + ->then(function(Payload $response) use ($messageToSent) { |
|
| 104 | 104 | $channel = $response->getData()['channel']['id']; |
| 105 | 105 | if ($messageToSent instanceof Message) { |
| 106 | 106 | $data['unfurl_links'] = false; |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | $cats = array(':smiley_cat:', ':smile_cat:', ':heart_eyes_cat:', ':kissing_cat:', ':smirk_cat:', ':scream_cat:', |
| 50 | - ':crying_cat_face:', ':joy_cat:' ,':pouting_cat:', ); |
|
| 50 | + ':crying_cat_face:', ':joy_cat:', ':pouting_cat:',); |
|
| 51 | 51 | |
| 52 | 52 | $responses = array( |
| 53 | 53 | 'daddy' => 'My daddy is Frank Nägler aka <@neoblack>', |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | $client = new Slack\RealTimeClient($loop); |
| 17 | 17 | $client->setToken($GLOBALS['config']['slack']['botAuthToken']); |
| 18 | 18 | |
| 19 | -$client->on('message', function (Slack\Payload $payload) use ($client) { |
|
| 19 | +$client->on('message', function(Slack\Payload $payload) use ($client) { |
|
| 20 | 20 | if ($payload->getData()['user'] !== $GLOBALS['config']['slack']['botId']) { |
| 21 | 21 | $commandResolver = new \T3Bot\Slack\CommandResolver($payload, $client); |
| 22 | 22 | $command = $commandResolver->resolveCommand(); |
@@ -31,21 +31,21 @@ discard block |
||
| 31 | 31 | } |
| 32 | 32 | }); |
| 33 | 33 | |
| 34 | -$client->on('presence_change', function (Slack\Payload $payload) use ($client) { |
|
| 34 | +$client->on('presence_change', function(Slack\Payload $payload) use ($client) { |
|
| 35 | 35 | if ($payload->getData()['user'] !== $GLOBALS['config']['slack']['botId']) { |
| 36 | 36 | $command = new \T3Bot\Commands\TellCommand($payload, $client); |
| 37 | 37 | $command->processPresenceChange($payload->getData()['user'], $payload->getData()['presence']); |
| 38 | 38 | } |
| 39 | 39 | }); |
| 40 | 40 | |
| 41 | -$client->connect()->then(function () use ($client) { |
|
| 41 | +$client->connect()->then(function() use ($client) { |
|
| 42 | 42 | echo "Connected!\n"; |
| 43 | 43 | }); |
| 44 | 44 | |
| 45 | 45 | /* @noinspection PhpInternalEntityUsedInspection */ |
| 46 | 46 | $db = \Doctrine\DBAL\DriverManager::getConnection($GLOBALS['config']['db'], new \Doctrine\DBAL\Configuration()); |
| 47 | 47 | |
| 48 | -$loop->addPeriodicTimer(5, function () use ($client, $db) { |
|
| 48 | +$loop->addPeriodicTimer(5, function() use ($client, $db) { |
|
| 49 | 49 | $messages = $db->fetchAll('SELECT * FROM messages ORDER BY id ASC'); |
| 50 | 50 | foreach ($messages as $message) { |
| 51 | 51 | $data = json_decode($message['message'], true); |