Skip to content

Commit

Permalink
Allow providing own driver for REST
Browse files Browse the repository at this point in the history
  • Loading branch information
Exanlv committed Mar 19, 2023
1 parent 8dce8a9 commit 1709cc9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 102 deletions.
97 changes: 0 additions & 97 deletions src/CommandHandler.php

This file was deleted.

14 changes: 9 additions & 5 deletions src/Discord.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Exan\Fenrir;

use Discord\Http\DriverInterface;
use Discord\Http\Drivers\Guzzle;
use Discord\Http\Http;
use Exan\Fenrir\Bitwise\Bitwise;
Expand Down Expand Up @@ -55,15 +56,18 @@ public function withGateway(
return $this;
}

public function withRest()
{
public function withRest(
DriverInterface $driver = null,
) {
$driver ??= new Guzzle(
$this->loop
);

$this->http = new Http(
'Bot ' . $this->token,
$this->loop,
$this->logger,
new Guzzle(
$this->loop
)
$driver
);

$this->rest = new Rest($this->http, $this->mapper);
Expand Down

0 comments on commit 1709cc9

Please sign in to comment.