Skip to content

Commit e949026

Browse files
authored
Update utils.py
1 parent b1b9948 commit e949026

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

discord/utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,8 +1112,7 @@ async def autocomplete_callback(ctx: AutocompleteContext) -> V:
11121112
_values = await _values
11131113

11141114
def check(item: Any) -> bool:
1115-
if hasattr(item, "to_dict"):
1116-
item = item.to_dict()["name"]
1115+
item = getattr(item, "name", item)
11171116
return str(item).lower().startswith(str(ctx.value or "").lower())
11181117

11191118
gen = (val for val in _values if check(val))

0 commit comments

Comments
 (0)