Skip to content

Commit b44c2bb

Browse files
Lulalabydependabot[bot]kbidlack
authored
Bump prod (#282)
* chore(deps): Bump ua-parser-js from 0.7.31 to 0.7.33 Bumps [ua-parser-js](https://github.com/faisalman/ua-parser-js) from 0.7.31 to 0.7.33. - [Release notes](https://github.com/faisalman/ua-parser-js/releases) - [Changelog](https://github.com/faisalman/ua-parser-js/blob/master/changelog.md) - [Commits](faisalman/ua-parser-js@0.7.31...0.7.33) --- updated-dependencies: - dependency-name: ua-parser-js dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> * clean up autocomplete example (#281) --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Kavi Bidlack <[email protected]>
1 parent 340bb49 commit b44c2bb

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

docs/interactions/application-commands/slash-commands.mdx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,12 @@ bot.run("TOKEN")
214214
</Tabs>
215215

216216
## Autocomplete
217-
Discord's autocomplete allows developers to determine option choices that are used in a slash command option. By defining a function, you can do this.
217+
Discord's autocomplete allows developers to determine option choices that are used in a slash command option. You can do this by defining a function:
218218

219219
```py
220220
async def get_animal_types(ctx: discord.AutocompleteContext):
221221
"""
222-
Here we will check if 'ctx.options['animal_type']' is and check if it's a marine or land animal and return specific option choices
222+
Here we will check if 'ctx.options['animal_type']' is a marine or land animal and return respective option choices
223223
"""
224224
animal_type = ctx.options['animal_type']
225225
if animal_type == 'Marine':
@@ -228,7 +228,11 @@ async def get_animal_types(ctx: discord.AutocompleteContext):
228228
return ['Snake', 'Wolf', 'Lizard', 'Lion', 'Bird']
229229

230230
@bot.slash_command(name="animal")
231-
async def animal_command(ctx: discord.ApplicationContext, animal_type: discord.Option(str, choices=['Marine', 'Land']), animal: discord.Option(str, autocomplete=discord.utils.basic_autocomplete(get_animals)):
231+
async def animal_command(
232+
ctx: discord.ApplicationContext,
233+
animal_type: discord.Option(str, choices=['Marine', 'Land']),
234+
animal: discord.Option(str, autocomplete=discord.utils.basic_autocomplete(get_animal_types))
235+
):
232236
await ctx.respond(f'You picked an animal type of `{animal_type}` that led you to pick `{animal}`!')
233237
```
234238

yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8904,9 +8904,9 @@ [email protected]:
89048904
integrity sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==
89058905

89068906
ua-parser-js@^0.7.30:
8907-
version "0.7.31"
8908-
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.31.tgz#649a656b191dffab4f21d5e053e27ca17cbff5c6"
8909-
integrity sha512-qLK/Xe9E2uzmYI3qLeOmI0tEOt+TBBQyUIAh4aAgU05FVYzeZrKUdkAZfBNVGRaHVgV0TDkdEngJSw/SyQchkQ==
8907+
version "0.7.33"
8908+
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.33.tgz#1d04acb4ccef9293df6f70f2c3d22f3030d8b532"
8909+
integrity sha512-s8ax/CeZdK9R/56Sui0WM6y9OFREJarMRHqLB2EwkovemBxNQ+Bqu8GAsUnVcXKgphb++ghr/B2BZx4mahujPw==
89108910

89118911
unherit@^1.0.4:
89128912
version "1.1.3"

0 commit comments

Comments
 (0)