From 7cdb7e63d3ebe017745e7ab8ff1435f053c9be1b Mon Sep 17 00:00:00 2001 From: Valithor Obsidion Date: Fri, 10 May 2024 14:06:32 -0400 Subject: [PATCH] Forgot to fix the link --- src/Discord/Parts/Channel/PollMedia.php | 48 +++++++++++++++++++++++ src/Discord/Parts/Channel/PollRequest.php | 2 +- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 src/Discord/Parts/Channel/PollMedia.php diff --git a/src/Discord/Parts/Channel/PollMedia.php b/src/Discord/Parts/Channel/PollMedia.php new file mode 100644 index 000000000..e7d1d636b --- /dev/null +++ b/src/Discord/Parts/Channel/PollMedia.php @@ -0,0 +1,48 @@ + + * + * This file is subject to the MIT license that is bundled + * with this source code in the LICENSE.md file. + */ + +namespace Discord\Parts\Channel; + +use Carbon\Carbon; +//use Discord\Builders\PartBuilder; +use Discord\Parts\Part; + + /** + * The poll object has a lot of levels and nested structures. It was also designed to support future extensibility, so some fields may appear to be more complex than necessary. + * This is the request object used when creating a poll across the different endpoints. It is similar but not exactly identical to the main poll object. The main difference is that the request has duration which eventually becomes expiry. + * + * @link https://discord.com/developers/docs/resources/poll#poll-object + * + * + * + * @property PollMedia|string $question The question of the poll. Only text is supported. + * @property PollAnswer[] $answers Each of the answers available in the poll, up to 10. + * @property int $duration Number of hours the poll should be open for, up to 7 days. + * @property bool $allow_multiselect Whether a user can select multiple answers. + * @property int|null $layout_type? The layout type of the poll. Defaults to... DEFAULT! + */ +class PollMedia extends Part +{ + public const LAYOUT_DEFAULT = 1; // The, uhm, default layout type. + + /** + * {@inheritdoc} + */ + protected $fillable = [ + 'question', + 'answers', + 'duration', + 'allow_multiselect', + 'layout_type' + ]; + + // TODO +} diff --git a/src/Discord/Parts/Channel/PollRequest.php b/src/Discord/Parts/Channel/PollRequest.php index c9e25d48c..9d5ec8429 100644 --- a/src/Discord/Parts/Channel/PollRequest.php +++ b/src/Discord/Parts/Channel/PollRequest.php @@ -19,7 +19,7 @@ * The poll object has a lot of levels and nested structures. It was also designed to support future extensibility, so some fields may appear to be more complex than necessary. * This is the request object used when creating a poll across the different endpoints. It is similar but not exactly identical to the main poll object. The main difference is that the request has duration which eventually becomes expiry. * - * @link https://discord.com/developers/docs/resources/poll#poll-object + * @link https://discord.com/developers/docs/resources/poll#poll-create-request-object-poll-create-request-object-structure * * *