Skip to content
This repository was archived by the owner on Mar 8, 2022. It is now read-only.

Commit 220647d

Browse files
author
kuso-senpai
committed
added exception if position is not int
1 parent 265ac9b commit 220647d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

discord_message_components/components.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,8 @@ def set_default_option(self, position: int) -> 'SelectMenu':
332332
------
333333
:raises: :class:`discord.InvalidArgument`: A passed argument was invalid
334334
"""
335+
if type(position) is not int:
336+
raise InvalidArgument("position has to be of type int, not " + str(type(position)))
335337
if position < 0 or position > len(self.options):
336338
raise InvalidArgument("default option position needs to be between 0 and " + str(len(self.options) - 1) + "(length of options)")
337339
self._json["options"][position]["default"] = True

0 commit comments

Comments
 (0)