File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
src/Discord/Parts/Channel Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 3131 *
3232 * @property PollMedia $question The question of the poll. Only text is supported.
3333 * @property PollAnswerRepository $answers Each of the answers available in the poll.
34- * @property Carbon $expiry The time when the poll ends.
34+ * @property Carbon|null $expiry The time when the poll ends.
3535 * @property bool $allow_multiselect Whether a user can select multiple answers.
3636 * @property int $layout_type The layout type of the poll.
3737 * @property PollResults|null $results The results of the poll.
@@ -101,12 +101,16 @@ protected function getQuestionAttribute(): PollMedia
101101 /**
102102 * Return the expiry attribute.
103103 *
104- * @return Carbon
104+ * @return Carbon|null
105105 *
106106 * @throws \Exception
107107 */
108- protected function getExpiryAttribute (): Carbon
108+ protected function getExpiryAttribute (): ? Carbon
109109 {
110+ if (! isset ($ this ->attributes ['expiry ' ])) {
111+ return null ;
112+ }
113+
110114 return Carbon::parse ($ this ->attributes ['expiry ' ]);
111115 }
112116
You can’t perform that action at this time.
0 commit comments