PHP Classes

File: examples/03-logging.php

Recommend this page to a friend!
  Packages of Max   Fenrir   examples/03-logging.php   Download  
File: examples/03-logging.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Fenrir
Use Discord services using the Web services API
Author: By
Last change:
Date: 4 months ago
Size: 492 bytes
 

 

Contents

Class file image Download
<?php

use Ragnarok\Fenrir\Discord;
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
use Ragnarok\Fenrir\Bitwise\Bitwise;

$log = new Logger('name', [new StreamHandler('/path/to/your.log')]); // Log to a file
$log = new Logger('name', [new StreamHandler('php://stdout')]); // Log to stdout (terminal output)

$discord = new Discord(
    'TOKEN',
    $log
);

$discord
    ->withGateway(new Bitwise())
    ->withRest();

$discord->gateway->open(); // Nothing after this line is executed