Skip to content

Commit 1671009

Browse files
Merge pull request #220 from artem30801/artem30801-fix-url-buttons
Fix get_components_ids when passing rows with URL ButtonStyle
2 parents a5b79bc + 8412c77 commit 1671009

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

discord_slash/utils/manage_components.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,10 @@ def get_components_ids(component: typing.Union[str, dict, list]) -> typing.Itera
215215
yield component
216216
elif isinstance(component, dict):
217217
if component["type"] == ComponentType.actionrow:
218-
yield from (comp["custom_id"] for comp in component["components"])
219-
else:
218+
yield from (
219+
comp["custom_id"] for comp in component["components"] if "custom_id" in comp
220+
)
221+
elif "custom_id" in component:
220222
yield component["custom_id"]
221223
elif isinstance(component, list):
222224
# Either list of components (actionrows or buttons) or list of ids

0 commit comments

Comments
 (0)