Skip to content

Commit 340bb49

Browse files
authored
Merge pull request #270 from Pycord-Development/main
prod
2 parents b580860 + c5f7422 commit 340bb49

File tree

8 files changed

+75
-39
lines changed

8 files changed

+75
-39
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
name: Deploy to GitHub Pages
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v3
1616
- uses: actions/setup-node@v3
1717
with:
1818
node-version: 18

.github/workflows/test-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
name: Test deployment
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v3
1919
- uses: actions/setup-node@v3
2020
with:
2121
node-version: 18

docs/extensions/commands/prefixed-commands.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ import random
299299
async def gtn(ctx, guess:int):
300300
number = random.randint(1, 10)
301301
if guess == number:
302-
await ctx.send("You guessed it!)
302+
await ctx.send("You guessed it!")
303303
else:
304304
await ctx.send("Nope! Better luck next time :)")
305305
```

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

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,42 @@ bot.run("TOKEN")
213213
</TabItem>
214214
</Tabs>
215215

216+
## 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.
218+
219+
```py
220+
async def get_animal_types(ctx: discord.AutocompleteContext):
221+
"""
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
223+
"""
224+
animal_type = ctx.options['animal_type']
225+
if animal_type == 'Marine':
226+
return ['Whale', 'Shark', 'Fish', 'Octopus', 'Turtle']
227+
else: # is land animal
228+
return ['Snake', 'Wolf', 'Lizard', 'Lion', 'Bird']
229+
230+
@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)):
232+
await ctx.respond(f'You picked an animal type of `{animal_type}` that led you to pick `{animal}`!')
233+
```
234+
235+
<DiscordComponent>
236+
<DiscordMessage profile="robocord">
237+
<div slot="interactions">
238+
<DiscordInteraction profile="bob" command>
239+
animal
240+
</DiscordInteraction>
241+
</div>
242+
You picked an animal type of <code>Marine</code> that led you to pick <code>Shark</code>!
243+
</DiscordMessage>
244+
</DiscordComponent>
245+
246+
:::warning
247+
248+
Autocomplete can **only** be used with slash commands.
249+
250+
:::
251+
216252
:::info Related Topics
217253

218254
- [Interactions Index](../../interactions)

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@
2929
"@docusaurus/core": "2.2.0",
3030
"@docusaurus/preset-classic": "2.2.0",
3131
"@easyops-cn/docusaurus-search-local": "0.27.1",
32-
"@matteusan/sentro": "0.1.23",
32+
"@matteusan/sentro": "0.1.25",
3333
"@mdx-js/react": "1.6.22",
3434
"@types/react": "17.0.2",
3535
"clsx": "1.2.1",
3636
"discord-message-components": "https://gitpkg.now.sh/Pycord-Development/discord-message-components?aa468ada9b2b52986ae0aee4051660713c1e9095&scripts.postinstall=yarn%20install%20--ignore-scripts%20%26%26%20node%20node_modules%2Fesbuild%2Finstall.js%20%26%26yarn%20build%3Amarkdown%20%26%26%20yarn%20build%3Acore%20%26%26%20yarn%20build%3Areact",
37-
"docusaurus-plugin-sass": "0.2.2",
37+
"docusaurus-plugin-sass": "0.2.3",
3838
"prism-react-renderer": "1.3.5",
3939
"react": "17.0.2",
4040
"react-dom": "17.0.2",
4141
"react-twemoji": "^0.5.0",
42-
"sass": "1.55.0",
43-
"webpack": "^5.74.0",
42+
"sass": "1.57.1",
43+
"webpack": "^5.75.0",
4444
"yarn": "^1.22.19"
4545
},
4646
"devDependencies": {
@@ -51,10 +51,10 @@
5151
"remark-comment": "^1.0.0",
5252
"remark-frontmatter": "^4.0.1",
5353
"remark-gfm": "^3.0.1",
54-
"remark-mdx": "^2.1.5",
54+
"remark-mdx": "^2.2.1",
5555
"remark-preset-lint-consistent": "^5.1.1",
5656
"remark-preset-lint-recommended": "^6.1.2",
57-
"typescript": "4.8.4"
57+
"typescript": "4.9.4"
5858
},
5959
"resolutions": {
6060
"@types/react": "17.0.2"

static/img/favicon.ico

10.5 KB
Binary file not shown.

static/img/logo.png

2.81 KB
Loading

yarn.lock

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1970,10 +1970,10 @@
19701970
resolved "https://registry.yarnpkg.com/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz#b2ac626d6cb9c8718ab459166d4bb405b8ffa78b"
19711971
integrity sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==
19721972

1973-
"@matteusan/[email protected].23":
1974-
version "0.1.23"
1975-
resolved "https://registry.yarnpkg.com/@matteusan/sentro/-/sentro-0.1.23.tgz#9554653f6d7eba7a6358c4dabb21b320b5bd4547"
1976-
integrity sha512-lVnDTSy/xjn7KHPkAXEGMCOHKSEY3OBMtbhfXxZu9ZcDWWbU57pttojVV/XMW7Wkr7BGOlM1hbBggzV22adTnA==
1973+
"@matteusan/[email protected].25":
1974+
version "0.1.25"
1975+
resolved "https://registry.yarnpkg.com/@matteusan/sentro/-/sentro-0.1.25.tgz#626f8795ada5f31a746acad80c4c49cc6134d879"
1976+
integrity sha512-WADroUoOEnbGBij9ZSJkGbYp2yiNVi6UJZymJsSVyo1zuekM1pIzKF8+nI31SGt5wS3ChmOOR5+w1Z7c6jg9TQ==
19771977

19781978
"@mdx-js/mdx@^1.6.22":
19791979
version "1.6.22"
@@ -3962,10 +3962,10 @@ dns-packet@^5.2.2:
39623962
dependencies:
39633963
"@leichtgewicht/ip-codec" "^2.0.1"
39643964

3965-
3966-
version "0.2.2"
3967-
resolved "https://registry.yarnpkg.com/docusaurus-plugin-sass/-/docusaurus-plugin-sass-0.2.2.tgz#9b7f8c6fbe833677064ec05b09b98d90b50be324"
3968-
integrity sha512-ZZBpj3PrhGpYE2kAnkZB9NRwy/CDi4rGun1oec6PYR8YvGzqxYGtXvLgHi6FFbu8/N483klk8udqyYMh6Ted+A==
3965+
3966+
version "0.2.3"
3967+
resolved "https://registry.yarnpkg.com/docusaurus-plugin-sass/-/docusaurus-plugin-sass-0.2.3.tgz#5b61f7e560d236cfc1531ed497ac32fc166fc5e2"
3968+
integrity sha512-FbaE06K8NF8SPUYTwiG+83/jkXrwHJ/Afjqz3SUIGon6QvFwSSoKOcoxGQmUBnjTOk+deUONDx8jNWsegFJcBQ==
39693969
dependencies:
39703970
sass-loader "^10.1.1"
39713971

@@ -5431,9 +5431,9 @@ json-schema-traverse@^1.0.0:
54315431
integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==
54325432

54335433
json5@^2.0.0, json5@^2.1.2, json5@^2.2.1:
5434-
version "2.2.1"
5435-
resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c"
5436-
integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==
5434+
version "2.2.3"
5435+
resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283"
5436+
integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==
54375437

54385438
jsonfile@^4.0.0:
54395439
version "4.0.0"
@@ -5535,9 +5535,9 @@ loader-runner@^4.2.0:
55355535
integrity sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==
55365536

55375537
loader-utils@^2.0.0:
5538-
version "2.0.2"
5539-
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.2.tgz#d6e3b4fb81870721ae4e0868ab11dd638368c129"
5540-
integrity sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==
5538+
version "2.0.4"
5539+
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.4.tgz#8b5cb38b5c34a9a018ee1fc0e6a066d1dfcc528c"
5540+
integrity sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==
55415541
dependencies:
55425542
big.js "^5.2.2"
55435543
emojis-list "^3.0.0"
@@ -7967,10 +7967,10 @@ [email protected]:
79677967
remark-parse "8.0.3"
79687968
unified "9.2.0"
79697969

7970-
remark-mdx@^2.1.5:
7971-
version "2.1.5"
7972-
resolved "https://registry.yarnpkg.com/remark-mdx/-/remark-mdx-2.1.5.tgz#69b19ec42d30a289e0663c3fc7656ebdca0a8d8e"
7973-
integrity sha512-A8vw5s+BgOa968Irt8BO7DfWJTE0Fe7Ge3hX8zzDB1DnwMZTNdK6qF2IcFao+/7nzk1vSysKcFp+3ku4vhMpaQ==
7970+
remark-mdx@^2.2.1:
7971+
version "2.2.1"
7972+
resolved "https://registry.yarnpkg.com/remark-mdx/-/remark-mdx-2.2.1.tgz#0d006436acf039b526c3b6b47ea4a44b3d544db7"
7973+
integrity sha512-R9wcN+/THRXTKyRBp6Npo/mcbGA2iT3N4G8qUqLA5pOEg7kBidHv8K2hHidCMYZ6DXmwK18umu0K4cicgA2PPQ==
79747974
dependencies:
79757975
mdast-util-mdx "^2.0.0"
79767976
micromark-extension-mdxjs "^1.0.0"
@@ -8223,10 +8223,10 @@ sass-loader@^10.1.1:
82238223
schema-utils "^3.0.0"
82248224
semver "^7.3.2"
82258225

8226-
sass@1.55.0:
8227-
version "1.55.0"
8228-
resolved "https://registry.yarnpkg.com/sass/-/sass-1.55.0.tgz#0c4d3c293cfe8f8a2e8d3b666e1cf1bff8065d1c"
8229-
integrity sha512-Pk+PMy7OGLs9WaxZGJMn7S96dvlyVBwwtToX895WmCpAOr5YiJYEUJfiJidMuKb613z2xNWcXCHEuOvjZbqC6A==
8226+
sass@1.57.1:
8227+
version "1.57.1"
8228+
resolved "https://registry.yarnpkg.com/sass/-/sass-1.57.1.tgz#dfafd46eb3ab94817145e8825208ecf7281119b5"
8229+
integrity sha512-O2+LwLS79op7GI0xZ8fqzF7X2m/m8WFfI02dHOdsK5R2ECeS5F62zrwg/relM1rjSLy7Vd/DiMNIvPrQGsA0jw==
82308230
dependencies:
82318231
chokidar ">=3.0.0 <4.0.0"
82328232
immutable "^4.0.0"
@@ -8898,10 +8898,10 @@ typedarray@^0.0.6:
88988898
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
88998899
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
89008900

8901-
typescript@4.8.4:
8902-
version "4.8.4"
8903-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6"
8904-
integrity sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==
8901+
typescript@4.9.4:
8902+
version "4.9.4"
8903+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.4.tgz#a2a3d2756c079abda241d75f149df9d561091e78"
8904+
integrity sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==
89058905

89068906
ua-parser-js@^0.7.30:
89078907
version "0.7.31"
@@ -9496,10 +9496,10 @@ webpack-sources@^3.2.2, webpack-sources@^3.2.3:
94969496
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde"
94979497
integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==
94989498

9499-
webpack@^5.73.0, webpack@^5.74.0:
9500-
version "5.74.0"
9501-
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.74.0.tgz#02a5dac19a17e0bb47093f2be67c695102a55980"
9502-
integrity sha512-A2InDwnhhGN4LYctJj6M1JEaGL7Luj6LOmyBHjcI8529cm5p6VXiTIW2sn6ffvEAKmveLzvu4jrihwXtPojlAA==
9499+
webpack@^5.73.0, webpack@^5.75.0:
9500+
version "5.75.0"
9501+
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.75.0.tgz#1e440468647b2505860e94c9ff3e44d5b582c152"
9502+
integrity sha512-piaIaoVJlqMsPtX/+3KTTO6jfvrSYgauFVdt8cr9LTHKmcq/AMd4mhzsiP7ZF/PGRNPGA8336jldh9l2Kt2ogQ==
95039503
dependencies:
95049504
"@types/eslint-scope" "^3.7.3"
95059505
"@types/estree" "^0.0.51"

0 commit comments

Comments
 (0)