mirror of
https://github.com/SrIzan10/awesome-plugins.git
synced 2026-05-01 10:35:27 +00:00
chore: update JavaScript plugins
This commit is contained in:
@@ -4,13 +4,14 @@
|
||||
* This is publish plugin, it allows you to publish your slash commands with ease.
|
||||
*
|
||||
* @author @EvolutionX-10 [<@697795666373640213>]
|
||||
* @version 1.2.0
|
||||
* @version 1.2.1
|
||||
* @example
|
||||
* ```ts
|
||||
* import { publish } from "../plugins/publish";
|
||||
* import { commandModule } from "@sern/handler";
|
||||
* export default commandModule({
|
||||
* plugins: [ publish() ], // put an object containing permissions, ids for guild commands, boolean for dmPermission
|
||||
* // plugins: [ publish({ guildIds: [], dmPermission: true})]
|
||||
* execute: (ctx) => {
|
||||
* //your code here
|
||||
* }
|
||||
@@ -19,19 +20,19 @@
|
||||
*/
|
||||
import { CommandType, PluginType } from "@sern/handler";
|
||||
import { ApplicationCommandType } from "discord.js";
|
||||
export function publish(
|
||||
options = {
|
||||
guildIds: [],
|
||||
dmPermission: true,
|
||||
defaultMemberPermissions: null,
|
||||
}
|
||||
) {
|
||||
export function publish(options) {
|
||||
return {
|
||||
type: PluginType.Command,
|
||||
description: "Manage Slash Commands",
|
||||
name: "slash-auto-publish",
|
||||
|
||||
async execute({ client }, { mod: module }, controller) {
|
||||
const defaultOptions = {
|
||||
guildIds: [],
|
||||
dmPermission: undefined,
|
||||
defaultMemberPermissions: null,
|
||||
};
|
||||
options = { ...defaultOptions, ...options };
|
||||
let { defaultMemberPermissions, dmPermission, guildIds } = options;
|
||||
|
||||
function c(e) {
|
||||
@@ -48,7 +49,6 @@ export function publish(
|
||||
defaultMemberPermissions,
|
||||
dmPermission,
|
||||
};
|
||||
if (!Array.isArray(guildIds)) guildIds = [guildIds];
|
||||
|
||||
if (!guildIds.length) {
|
||||
const cmd = (
|
||||
|
||||
Reference in New Issue
Block a user