Skip to content

Commit

Permalink
Allow passing of DataMapper in Discord constructor
Browse files Browse the repository at this point in the history
Exanlv committed Dec 19, 2024
1 parent 7ab42e4 commit 0592bd3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Discord.php
Original file line number Diff line number Diff line change
@@ -32,13 +32,14 @@ class Discord
public function __construct(
private string $token,
private LoggerInterface $logger = new NullLogger(),
?LoopInterface $loop = null
?LoopInterface $loop = null,
?DataMapper $dataMapper = null,
) {
$this->logger->info('Fenrir initialized. Discriminators > usernames');

$this->loop = $loop ?? Loop::get();

$this->mapper = new DataMapper($this->logger);
$this->mapper = $dataMapper ?? new DataMapper(new NullLogger());
}

/**

0 comments on commit 0592bd3

Please sign in to comment.