deprecate prefix commands

This commit is contained in:
SowinskiBraeden committed 2022-08-06 10:19:41 -07:00
1 parent 0d69c6c79d
commit 88f89eae11
29 files changed
+34 -1012

No files matched your search

+9 -96
View File
@@ -8,77 +8,6 @@ module.exports = {
channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"],
member: [],
},
aliases: ["command", "commands", "cmd"],
/**
*
* @param {require("../structures/LinesPoliceCadBot")} client
* @param {import("discord.js").Message} message
* @param {string[]} args
* @param {*} param3
*/
run: async (client, message, args, { GuildDB }) => {
let Commands = client.commands.map((cmd) =>
cmd.name != 'debug' ? `\`${GuildDB ? GuildDB.prefix : client.config.DefaultPrefix}${
cmd.name
}${cmd.usage ? " " + cmd.usage : ""}\` - ${cmd.description}` : null
);
let Embed = new MessageEmbed()
.setAuthor(
`Commands of ${client.user.username}`,
client.config.IconURL
)
.setColor(client.config.EmbedColor)
.setFooter(
`To get info of each command type ${
GuildDB ? GuildDB.prefix : client.config.DefaultPrefix
}help [Command] | Have a nice day!`
).setDescription(`${Commands.join("\n")}
Lines Police CAD Bot Version: v${client.config.Version}`);
if (!args[0]) {
message.channel.send({ embeds: [Embed] });
}
else {
let cmd =
client.commands.get(args[0]) ||
client.commands.find((x) => x.aliases && x.aliases.includes(args[0]));
if (!cmd)
return client.sendTime(
message.channel,
`❌ | Unable to find that command.`
);
let embed = new MessageEmbed()
.setAuthor(`Command: ${cmd.name}`, client.config.IconURL)
.setDescription(cmd.description)
.setColor("GREEN")
//.addField("Name", cmd.name, true)
.addField("Aliases", `\`${cmd.aliases.join(", ")}\``, true)
.addField(
"Usage",
`\`${GuildDB ? GuildDB.prefix : client.config.DefaultPrefix}${
cmd.name
}${cmd.usage ? " " + cmd.usage : ""}\``,
true
)
.addField(
"Permissions",
"Member: " +
cmd.permissions.member.join(", ") +
"\nBot: " +
cmd.permissions.channel.join(", "),
true
)
.setFooter(
`Prefix - ${
GuildDB ? GuildDB.prefix : client.config.DefaultPrefix
}`
);
message.channel.send({ embeds: [embed] });
}
},
SlashCommand: {
options: [
{
@@ -101,25 +30,18 @@ module.exports = {
if (GuildDB.customChannelStatus==true&&!GuildDB.allowedChannels.includes(interaction.channel_id)) {
return interaction.send(`You are not allowed to use the bot in this channel.`);
}
let Commands = client.commands.map((cmd) =>
cmd.name != 'debug' ? `\`${GuildDB ? GuildDB.prefix : client.config.DefaultPrefix}${
cmd.name
}${cmd.usage ? " " + cmd.usage : ""}\` - ${cmd.description}` : null
let Commands = client.commands.filter((cmd) => {
if (client.exists(cmd.debug)) return !cmd.debug
else return true
}).map((cmd) =>
`\`/${cmd.name}${cmd.usage ? " " + cmd.usage : ""}\` - ${cmd.description}`
);
let Embed = new MessageEmbed()
.setAuthor(
`Commands of ${client.user.username}`,
client.config.IconURL
)
.setColor(client.config.EmbedColor)
.setFooter(
`To get info of each command type ${
GuildDB ? GuildDB.prefix : client.config.DefaultPrefix
}help [Command] | Have a nice day!`
).setDescription(`${Commands.join("\n")}
.setDescription(`${Commands.join("\n")}
Lines Police CAD Bot Version: v${client.config.Version}`);
LPC Bot Version: v${client.config.Version}`);
if (!args) return interaction.send(Embed);
else {
let cmd =
@@ -137,13 +59,9 @@ module.exports = {
.setAuthor(`Command: ${cmd.name}`, client.config.IconURL)
.setDescription(cmd.description)
.setColor("GREEN")
//.addField("Name", cmd.name, true)
.addField("Aliases", cmd.aliases.join(", "), true)
.addField(
"Usage",
`\`${GuildDB ? GuildDB.prefix : client.config.DefaultPrefix}${
cmd.name
}\`${cmd.usage ? " " + cmd.usage : ""}`,
`\`/${cmd.name}${cmd.usage ? " " + cmd.usage : ""}\``,
true
)
.addField(
@@ -154,13 +72,8 @@ module.exports = {
cmd.permissions.channel.join(", "),
true
)
.setFooter(
`Prefix - ${
GuildDB ? GuildDB.prefix : client.config.DefaultPrefix
}`
);
interaction.send(embed);
return interaction.send(embed);
}
},
},