Closed Iinksafe closed 2 years ago
Screenshot:
I've tried this, and it may be caused by the cursor not working on abc.py
in function slash_command()
.
i tried to query 50 slash commands with
[ command async for command in message.channel.slash_commands(limit = 50) ]
which yield :
[
<SlashCommand id=1011560371267579943 name='8ball' options=1>,
<SlashCommand id=1011560371041095693 name='achievements'>,
<SlashCommand id=1011560371041095694 name='advancements' children=4>,
<SlashCommand id=1011560371041095695 name='adventure'>,
<SlashCommand id=1011560370864930852 name='alert'>,
<SlashCommand id=1011560371309510699 name='animals' options=1>,
<SlashCommand id=1011560370994954287 name='audit'>,
<SlashCommand id=1011560371041095696 name='badges'>,
<SlashCommand id=1011560371041095697 name='balance' options=1>,
<SlashCommand id=1011560371041095698 name='bankrob' options=1>,
<SlashCommand id=1011560371041095699 name='beg'>,
<SlashCommand id=1011560371078832199 name='blackjack' options=1>,
<SlashCommand id=1011560370994954288 name='block' children=3>,
<SlashCommand id=1011560371078832200 name='bundles' children=2>,
<SlashCommand id=1011560370864930854 name='buy' options=3>,
<SlashCommand id=1011560370948800551 name='clap' options=1>,
<SlashCommand id=1011560370864930855 name='compare' options=1>,
<SlashCommand id=1011560371078832201 name='craft'>,
<SlashCommand id=1011560371078832202 name='crime'>,
<SlashCommand id=1011560371078832203 name='currencylog'>,
<SlashCommand id=1011560370864930856 name='daily'>,
<SlashCommand id=1011560370911072256 name='deposit' options=1>,
<SlashCommand id=1011560371078832204 name='dig'>,
<SlashCommand id=1011560371041095690 name='donor' children=2>,
<SlashCommand id=1011560371078832205 name='drops'>,
<SlashCommand id=1011560371267579943 name='8ball' options=1>,
<SlashCommand id=1011560371041095693 name='achievements'>,
<SlashCommand id=1011560371041095694 name='advancements' children=4>,
<SlashCommand id=1011560371041095695 name='adventure'>,
<SlashCommand id=1011560370864930852 name='alert'>,
<SlashCommand id=1011560371309510699 name='animals' options=1>,
<SlashCommand id=1011560370994954287 name='audit'>,
<SlashCommand id=1011560371041095696 name='badges'>,
<SlashCommand id=1011560371041095697 name='balance' options=1>,
<SlashCommand id=1011560371041095698 name='bankrob' options=1>,
<SlashCommand id=1011560371041095699 name='beg'>,
<SlashCommand id=1011560371078832199 name='blackjack' options=1>,
<SlashCommand id=1011560370994954288 name='block' children=3>,
<SlashCommand id=1011560371078832200 name='bundles' children=2>,
<SlashCommand id=1011560370864930854 name='buy' options=3>,
<SlashCommand id=1011560370948800551 name='clap' options=1>,
<SlashCommand id=1011560370864930855 name='compare' options=1>,
<SlashCommand id=1011560371078832201 name='craft'>,
<SlashCommand id=1011560371078832202 name='crime'>,
<SlashCommand id=1011560371078832203 name='currencylog'>,
<SlashCommand id=1011560370864930856 name='daily'>,
<SlashCommand id=1011560370911072256 name='deposit' options=1>,
<SlashCommand id=1011560371078832204 name='dig'>,
<SlashCommand id=1011560371041095690 name='donor' children=2>,
<SlashCommand id=1011560371078832205 name='drops'>
]
you can see that the slashes command loop after the 25th list, which is exactly what abc.py on line 1821 hard coded as max retrieve.
# abc.py : line 1819 - 1823
while True:
cursor = MISSING
retrieve = min(25 if limit is None else limit, 25)
if retrieve < 1 or cursor is None:
return
the only workaround, for now, is to do a separate fetch for each application, which has a greater limit.
This should be fixed.
Summary
Running
channel.slash_commands()
yields Slash Commands infinitely.Reproduction Steps
Client.get_channel(<Snowflake id>)
TextChannel.slash_commands()
Code
Expected Results
Return the Slash Commands and exit the async generator once it has finished.
Actual Results
The function returns the Slash Commands but yields infinitely.
System Information
Checklist
Additional Information
Example of what it yields (let's say we only have 5 Slash Commands with 3 bots):