Skip to content

Commit 284d40c

Browse files
nexy7574pre-commit-ci[bot]Dorukyum
authored
fix: options initializing with null input type (Pycord-Development#2464)
* Prevent Option.__init__() completing with a null input type * Update changelog (for the checkbox) * style(pre-commit): auto fixes from pre-commit.com hooks * Update CHANGELOG.md Signed-off-by: Dorukyum <[email protected]> * style(pre-commit): auto fixes from pre-commit.com hooks --------- Signed-off-by: Dorukyum <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Dorukyum <[email protected]>
1 parent 9ab4bd6 commit 284d40c

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ These changes are available on the `master` branch, but have not yet been releas
5656
([#2458](https://github.com/Pycord-Development/pycord/pull/2458))
5757
- Fixed many inaccurate type hints throughout the library.
5858
([#2457](https://github.com/Pycord-Development/pycord/pull/2457))
59+
- Fixed `AttributeError` due to `discord.Option` being initialised with `input_type` set
60+
to `None`. ([#2464](https://github.com/Pycord-Development/pycord/pull/2464))
5961

6062
### Changed
6163

discord/commands/options.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,9 @@ def __init__(
330330
"description_localizations", MISSING
331331
)
332332

333+
if input_type is None:
334+
raise TypeError("input_type cannot be NoneType.")
335+
333336
def to_dict(self) -> dict:
334337
as_dict = {
335338
"name": self.name,

0 commit comments

Comments
 (0)