diff options
| author | 2019-08-19 20:10:48 +0800 | |
|---|---|---|
| committer | 2019-08-19 20:10:48 +0800 | |
| commit | fd6e975d6dfe587a534b081c7853f04201f22ed4 (patch) | |
| tree | 6aa952e177c51c89afcb85b848173b70b536ee5d /bot/utils/__init__.py | |
| parent | Merge pull request #257 from vivax3794/minesweeper-lenght-fix (diff) | |
Replace paramater and return value docstring documentation with an extended summary
Diffstat (limited to 'bot/utils/__init__.py')
| -rw-r--r-- | bot/utils/__init__.py | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/bot/utils/__init__.py b/bot/utils/__init__.py index ef18a1b9..15c4b5db 100644 --- a/bot/utils/__init__.py +++ b/bot/utils/__init__.py @@ -9,21 +9,15 @@ from bot.pagination import LinePaginator async def disambiguate( ctx: Context, entries: List[str], *, timeout: float = 30, - per_page: int = 20, empty: bool = False, embed: discord.Embed = None -): + entries_per_page: int = 20, empty: bool = False, embed: discord.Embed = None +) -> str: """ Has the user choose between multiple entries in case one could not be chosen automatically. + Disambiguation will be canceled after `timeout` seconds. + This will raise a BadArgument if entries is empty, if the disambiguation event times out, or if the user makes an invalid choice. - - :param ctx: Context object from discord.py - :param entries: List of items for user to choose from - :param timeout: Number of seconds to wait before canceling disambiguation - :param per_page: Entries per embed page - :param empty: Whether the paginator should have an extra line between items - :param embed: The embed that the paginator will use. - :return: Users choice for correct entry. """ if len(entries) == 0: raise BadArgument('No matches found.') @@ -43,7 +37,7 @@ async def disambiguate( embed = discord.Embed() coro1 = ctx.bot.wait_for('message', check=check, timeout=timeout) - coro2 = LinePaginator.paginate(choices, ctx, embed=embed, max_lines=per_page, + coro2 = LinePaginator.paginate(choices, ctx, embed=embed, max_lines=entries_per_page, empty=empty, max_size=6000, timeout=9000) # wait_for timeout will go to except instead of the wait_for thing as I expected |