Skip to content

Commit 5a0b81a

Browse files
authored
Merge pull request #389 from MeidoNoHitsuji/unstable
(f) fixed correct getting options in command
2 parents 75f6a96 + 5f3f571 commit 5a0b81a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

interactions/models/command.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,10 @@ def __init__(self, **kwargs) -> None:
108108
self.type = OptionType(self.type)
109109
self._json.update({"type": self.type.value})
110110
if self._json.get("options"):
111-
self._json["options"] = [option._json for option in self.options]
111+
if all(isinstance(option, dict) for option in self.options):
112+
self._json["options"] = [option for option in self.options]
113+
else:
114+
self._json["options"] = [option._json for option in self.options]
112115
if self._json.get("choices"):
113116
if isinstance(self._json.get("choices"), dict):
114117
self._json["choices"] = [choice for choice in self.choices]

0 commit comments

Comments
 (0)