Skip to content

Commit 4aac8ce

Browse files
Fixed converter request (#1)
* Fixed converter request * Update dico_command/converter.py Co-authored-by: Eunwoo Choi <[email protected]> * Update dico_command/converter.py Co-authored-by: Eunwoo Choi <[email protected]> * Update dico_command/converter.py Co-authored-by: Eunwoo Choi <[email protected]> * Update dico_command/converter.py Co-authored-by: Eunwoo Choi <[email protected]> Co-authored-by: Eunwoo Choi <[email protected]>
1 parent 1687fa1 commit 4aac8ce

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dico_command/converter.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ async def convert(self, ctx: "Context", value: str) -> Optional[T]:
5353
maybe_id = value if re.match(r"^\d+$", value) else maybe_mention
5454
with suppress(HTTPError):
5555
if maybe_id:
56-
return search(cached, id=maybe_id) or await self.bot.http.request_user(maybe_id)
56+
return search(cached, id=maybe_id) or await self.bot.request_user(maybe_id)
5757
from_username = search(cached, username=value)
5858
if from_username:
5959
return from_username
@@ -76,7 +76,7 @@ async def convert(self, ctx: "Context", value: str) -> Optional[T]:
7676
maybe_id = value if re.match(r"^\d+$", value) else maybe_mention
7777
with suppress(HTTPError):
7878
if maybe_id:
79-
return search(cached, id=maybe_id) or await self.bot.http.request_user(maybe_id)
79+
return search(cached, id=maybe_id) or await self.bot.request_guild_member(ctx.guild_id, maybe_id)
8080
from_name = search(cached, __str__=value)
8181
if from_name:
8282
return from_name
@@ -92,7 +92,7 @@ async def convert(self, ctx: "Context", value: str) -> Optional[T]:
9292
maybe_id = value if re.match(r"^\d+$", value) else maybe_mention
9393
with suppress(HTTPError):
9494
if maybe_id:
95-
return search(cached, id=maybe_id) or await self.bot.http.request_user(maybe_id)
95+
return search(cached, id=maybe_id) or await self.bot.request_channel(maybe_id)
9696
from_name = search(cached, name=value)
9797
if from_name:
9898
return from_name
@@ -107,7 +107,7 @@ async def convert(self, ctx: "Context", value: str) -> Optional[T]:
107107
maybe_id = value if re.match(r"^\d+$", value) else maybe_mention
108108
with suppress(HTTPError):
109109
if maybe_id:
110-
return search(cached, id=maybe_id) or await self.bot.http.request_user(maybe_id)
110+
return search(cached, id=maybe_id) or search(await self.bot.request_guild_roles(ctx.guild_id), id=maybe_id)
111111
from_name = search(cached, name=value)
112112
if from_name:
113113
return from_name

0 commit comments

Comments
 (0)