fix(guide): Miscellaneous fixes (#11147)

* fix: miscellaneous fixes

* docs: fix contributing link

* fix: link

* fix: you

* fix: main links

* fix: update source

* fix: update link

* fix: update update link

* fix: [

* fix: remove locale

* fix: update links

* fix: update GitHub link

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Jiralite
2025-10-09 13:41:15 +01:00
committed by GitHub
parent 7f29356950
commit a97ac82619
47 changed files with 113 additions and 115 deletions

View File

@@ -37,12 +37,12 @@ module.exports = {
};
```
Since `reason` isn't a required option, the example above uses the `??` [nullish coalescing operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing_operator) to set a default value in case the user does not supply a value for `reason`.
Since `reason` isn't a required option, the example above uses the `??` [nullish coalescing operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing_operator) to set a default value in case the user does not supply a value for `reason`.
If the target user is still in the guild where the command is being run, you can also use `.getMember('target')` to get their `GuildMember` object.
<Callout>
If you want the id (Snowflake) of a structure instead, grab the option via `get()` and access the Snowflake via the `value` property. Note that you should use `const { value: name } = ...` here to [destructure and rename](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) the value obtained from the `CommandInteractionOption` structure to avoid identifier name conflicts.
If you want the id (Snowflake) of a structure instead, grab the option via `get()` and access the Snowflake via the `value` property. Note that you should use `const { value: name } = ...` here to [destructure and rename](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) the value obtained from the `CommandInteractionOption` structure to avoid identifier name conflicts.
</Callout>
In the same way as the above examples, you can get values of any type using the corresponding `CommandInteractionOptionResolver#get_____()` method. `String`, `Integer`, `Number` and `Boolean` options all provide the respective primitive types, while `User`, `Channel`, `Role`, and `Mentionable` options will provide either the respective discord.js class instance if your application has a bot user in the guild or a raw API structure for commands-only deployments.

View File

@@ -28,13 +28,13 @@ const data = new SlashCommandBuilder()
.setDefaultMemberPermissions(PermissionFlagsBits.BanMembers); // [!code ++]
```
For a kick command however, yout can allow members with the `KickMembers` permission to execute the command, so that's why the flag is listed here here.
For a kick command however, you can allow members with the `KickMembers` permission to execute the command, so that's why the flag is listed here here.
<Callout>
You can require the user to have all of multiple permissions by merging them with the `|` bitwise OR operator (for example `PermissionFlagsBits.BanMembers | PermissionFlagsBits.KickMembers`).
You cannot require any of multiple permissions. Discord evaluates against the combined permission bitfield!
If you want to learn more about the `|` bitwise OR operator you can check the [Wikipedia](https://en.wikipedia.org/wiki/Bitwise_operation#OR) and [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_OR) articles on the topic.
If you want to learn more about the `|` bitwise OR operator you can check the [Wikipedia](https://en.wikipedia.org/wiki/Bitwise_operation#OR) and [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Bitwise_OR) articles on the topic.
</Callout>