Skip to content

Commit

Permalink
use method getReduced
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateodioev committed May 10, 2023
1 parent dd4ea3e commit 49dab31
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/All.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class All extends AllEvent
public function execute(Api $bot, Context $context, array $args = [])
{
$type = $context->eventType()->prettyName();
$raw = \json_encode($context->get(), JSON_PRETTY_PRINT);
$raw = \json_encode($context->getReduced(), JSON_PRETTY_PRINT);

$this->getLogger()->info('Receive new {type} event', compact('type'));
$this->getLogger()->info('Update: {raw}', compact('raw'));
Expand Down
2 changes: 1 addition & 1 deletion examples/bot.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
require __DIR__ . '/Message.php';
require __DIR__ . '/All.php';

$bot = new Bot($_ENV['BOT_TOKEN']); // put your bot token here
$bot = new Bot($_ENV['BOT_TOKEN'] ?? getenv('BOT_TOKEN')); // put your bot token here

// Log php error and print in terminal
BulkStream::add(new TerminalStream);
Expand Down

0 comments on commit 49dab31

Please sign in to comment.