Publisher
Bu içerik henüz dilinizde mevcut değil.
Publish application commands as a service!
Usage
Initializing the Publisher
Implicits
- Requires process.env to be populated
- A common provider of this is
dotenv
- Calls the discord API with the PUT route. Wherever your commands directory is located, publish will override the existing application commands at Discord.
Features
- Automatically syncs api with your command base
- generates JSON file of output (.sern/command-data-remote.json)
- supports a configuration that is the same as the original publish plugin.
Each command file can have an extra plugin publishConfig
that follows ValidPublishOptions
:
Config
Example: command published with integrationTypes
Example: command published in guild
Explanation of each property in the plugin
-
guildIds
: Commands will be published to guilds specified.- Can have more than one guild id to publish certain commands in
- These commands cannot be used in dms.
-
defaultMemberPermissions
: Only members with specified permissions can view the command- If you specify more than one, all perms are required!
-
integrationTypes
: able to specify guild install or user install commands- ’Guild’: Command is only able to be used in guilds
- ’User’: Command can be installed to a users profile to be used everywhere (with limitations)
- Guilds with less than 200 members, developer can specify if the command should be invisible to others (ephemeral)
- Guild with >= 200 members, commands will be forced to be invisible by the Discord API.
-
contexts
: specify where the user installed commands can be used.- 0: Only available to be used by the user in GUILDS.
- 1: Only available in Bot dms.
- 2: Any private channel, such as a group dm outside of bots dms.
- Also able to use IntegrationContextType enum from
@sern/publisher
if you don’t want to use numbers.