more info

This commit is contained in:
jacob
2023-09-25 11:00:06 -05:00
parent a48f96841a
commit c7a06a0779

View File

@@ -33,24 +33,29 @@ If you do not know how to obtain either of these credentials, [click here](https
- Automatically syncs api with your command base
- generates JSON file of output (**.sern/command-data-remote.json**)
- supports publishing direct esm typescript files
- commonjs users need to compile first and then run sern publish on the dist/ output
- commonjs + javascript users need to compile first and then run sern publish on the dist/ output
- prerequire scripts.
- supports a configuration that is the same as the original publish plugin.
Each command file can have an extra config that follows this typescript interface:
PermissionResolvable is a discord.js type, but it will accept anything that the discord API accepts
Each command file can have an extra config that follows `ValidPublishOptions`:
## Config
```ts
interface ValidPublishOptions {
type ValidMemberPermissions =
| PermissionFlagBits //discord.js enum
| PermissionFlagBits[] //array of discord.js enum
| string //must be a stringified number
| bigint
interface PublishConfig {
guildIds: string[];
dmPermission: boolean;
defaultMemberPermissions: PermissionResolvable;
defaultMemberPermissions: ValidMemberPermissions;
}
type Options =
| ValidPublishOptions
| (absPath: string, module: CommandModule) => ValidPublishOptions
type ValidPublishOptions =
| PublishConfig
| (absPath: string, module: CommandModule) => PublishConfig
```
In other words, you can export a function or object.