-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚧 Create a repository for poll answers
🎨 Add docblock for event fillable attributes 🎨 Improve return types 🎨 Rename `Poll::end` to `Poll::expire` for parity with the Discord API
- Loading branch information
Showing
2 changed files
with
74 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
/* | ||
* This file is a part of the DiscordPHP project. | ||
* | ||
* Copyright (c) 2015-present David Cole <david.cole1340@gmail.com> | ||
* | ||
* This file is subject to the MIT license that is bundled | ||
* with this source code in the LICENSE.md file. | ||
*/ | ||
|
||
namespace Discord\Repository\Channel; | ||
|
||
use Discord\Http\Endpoint; | ||
use Discord\Parts\Channel\Poll\PollAnswer; | ||
use Discord\Repository\AbstractRepository; | ||
use React\Promise\ExtendedPromiseInterface; | ||
|
||
/** | ||
* Contains poll answers on a poll in a message. | ||
* | ||
* @see PollAnswer | ||
* @see \Discord\Parts\Channel\Poll | ||
* @see \Discord\Parts\Channel\Message | ||
* | ||
* @since 10.0.0 | ||
* | ||
* @method PollAnswer|null get(string $discrim, $key) | ||
* @method PollAnswer|null pull(string|int $key, $default = null) | ||
* @method PollAnswer|null first() | ||
* @method PollAnswer|null last() | ||
* @method PollAnswer|null find(callable $callback) | ||
*/ | ||
class PollAnswerRepository extends AbstractRepository | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected $endpoints = [ | ||
'get' => Endpoint::MESSAGE_POLL_ANSWER, | ||
]; | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected $class = PollAnswer::class; | ||
} |