Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Commit

Permalink
feat: new public cmds + renamed cmd folderes
Browse files Browse the repository at this point in the history
  • Loading branch information
wdhdev committed Jun 27, 2023
1 parent dcb74ea commit ce1e26d
Show file tree
Hide file tree
Showing 23 changed files with 129 additions and 104 deletions.
104 changes: 0 additions & 104 deletions src/commands/developer/admin.js → src/commands/dev/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,6 @@ module.exports = {
]
},

{
type: 1,
name: "developers",
description: "Get a list of all the developers.",
options: []
},

{
type: 2,
name: "mod",
Expand Down Expand Up @@ -86,13 +79,6 @@ module.exports = {
]
},

{
type: 1,
name: "moderators",
description: "Get a list of all the moderators.",
options: []
},

{
type: 1,
name: "send-appeal-menu",
Expand Down Expand Up @@ -123,13 +109,6 @@ module.exports = {
]
},

{
type: 1,
name: "supporters",
description: "Get a list of all the supporters.",
options: []
},

{
type: 1,
name: "unverify",
Expand Down Expand Up @@ -272,33 +251,6 @@ module.exports = {
return;
}

if(interaction.options.getSubcommand() === "developers") {
const devs = await devSchema.find();

const users = [];

for(const user of devs) {
users.push(user._id);
}

if(!users.length) {
const error = new Discord.EmbedBuilder()
.setColor(client.config_embeds.error)
.setDescription(`${emoji.error} There are no developers!`)

await interaction.editReply({ embeds: [error], ephemeral: true });
return;
}

const developers = new Discord.EmbedBuilder()
.setColor(client.config_embeds.default)
.setTitle("💻 Developers")
.setDescription(`<@${users.join(">\n<@")}>`)

await interaction.editReply({ embeds: [developers] });
return;
}

if(interaction.options.getSubcommandGroup() === "mod") {
const user = interaction.options.getUser("user");

Expand Down Expand Up @@ -378,33 +330,6 @@ module.exports = {
return;
}

if(interaction.options.getSubcommand() === "moderators") {
const mods = await modSchema.find();

const users = [];

for(const user of mods) {
users.push(user._id);
}

if(!users.length) {
const error = new Discord.EmbedBuilder()
.setColor(client.config_embeds.error)
.setDescription(`${emoji.error} There are no moderators!`)

await interaction.editReply({ embeds: [error], ephemeral: true });
return;
}

const moderators = new Discord.EmbedBuilder()
.setColor(client.config_embeds.default)
.setTitle("🔨 Moderators")
.setDescription(`<@${users.join(">\n<@")}>`)

await interaction.editReply({ embeds: [moderators] });
return;
}

if(interaction.options.getSubcommand() === "send-appeal-menu") {
const channel = interaction.options.getChannel("channel");
const appealChannel = client.channels.cache.get(channel.id);
Expand Down Expand Up @@ -523,35 +448,6 @@ module.exports = {
return;
}

if(interaction.options.getSubcommand() === "supporters") {
const guild = await client.guilds.fetch(client.config_default.guild);
const members = await guild.members.fetch();
const boosters = members.filter(member => member.premiumSinceTimestamp);

const users = [];

for(const [userId, guildMember] of boosters) {
users.push(userId);
}

if(!users.length) {
const error = new Discord.EmbedBuilder()
.setColor(client.config_embeds.error)
.setDescription(`${emoji.error} There are no supporters!`)

await interaction.editReply({ embeds: [error], ephemeral: true });
return;
}

const supporters = new Discord.EmbedBuilder()
.setColor(client.config_embeds.default)
.setTitle("💖 Supporters")
.setDescription(`<@${users.join(">\n<@")}>`)

await interaction.editReply({ embeds: [supporters] });
return;
}

if(interaction.options.getSubcommand() === "unverify") {
const user = interaction.options.getUser("user");

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
43 changes: 43 additions & 0 deletions src/commands/info/developers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
const emoji = require("../../config.json").emojis;

const devSchema = require("../../models/devSchema");

module.exports = {
name: "developers",
description: "Get a list of all the developers.",
options: [],
default_member_permissions: null,
botPermissions: [],
cooldown: 0,
enabled: true,
hidden: true,
async execute(interaction, client, Discord) {
try {
const devs = await devSchema.find();

const users = [];

for(const user of devs) {
users.push(user._id);
}

if(!users.length) {
const error = new Discord.EmbedBuilder()
.setColor(client.config_embeds.error)
.setDescription(`${emoji.error} There are no developers!`)

await interaction.editReply({ embeds: [error], ephemeral: true });
return;
}

const developers = new Discord.EmbedBuilder()
.setColor(client.config_embeds.default)
.setTitle("💻 Developers")
.setDescription(`<@${users.join(">\n<@")}>`)

await interaction.editReply({ embeds: [developers] });
} catch(err) {
client.logCommandError(err, interaction, Discord);
}
}
}
File renamed without changes.
File renamed without changes.
43 changes: 43 additions & 0 deletions src/commands/info/moderators.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
const emoji = require("../../config.json").emojis;

const modSchema = require("../../models/modSchema");

module.exports = {
name: "moderators",
description: "Get a list of all the moderators.",
options: [],
default_member_permissions: null,
botPermissions: [],
cooldown: 0,
enabled: true,
hidden: true,
async execute(interaction, client, Discord) {
try {
const mods = await modSchema.find();

const users = [];

for(const user of mods) {
users.push(user._id);
}

if(!users.length) {
const error = new Discord.EmbedBuilder()
.setColor(client.config_embeds.error)
.setDescription(`${emoji.error} There are no moderators!`)

await interaction.editReply({ embeds: [error], ephemeral: true });
return;
}

const moderators = new Discord.EmbedBuilder()
.setColor(client.config_embeds.default)
.setTitle("🔨 Moderators")
.setDescription(`<@${users.join(">\n<@")}>`)

await interaction.editReply({ embeds: [moderators] });
} catch(err) {
client.logCommandError(err, interaction, Discord);
}
}
}
File renamed without changes.
File renamed without changes.
43 changes: 43 additions & 0 deletions src/commands/info/supporters.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
const emoji = require("../../config.json").emojis;

module.exports = {
name: "supporters",
description: "Get a list of all the supporters.",
options: [],
default_member_permissions: null,
botPermissions: [],
cooldown: 0,
enabled: true,
hidden: true,
async execute(interaction, client, Discord) {
try {
const guild = await client.guilds.fetch(client.config_default.guild);
const members = await guild.members.fetch();
const boosters = members.filter(member => member.premiumSinceTimestamp);

const users = [];

for(const [userId, guildMember] of boosters) {
users.push(userId);
}

if(!users.length) {
const error = new Discord.EmbedBuilder()
.setColor(client.config_embeds.error)
.setDescription(`${emoji.error} There are no supporters!`)

await interaction.editReply({ embeds: [error], ephemeral: true });
return;
}

const supporters = new Discord.EmbedBuilder()
.setColor(client.config_embeds.default)
.setTitle("💖 Supporters")
.setDescription(`<@${users.join(">\n<@")}>`)

await interaction.editReply({ embeds: [supporters] });
} catch(err) {
client.logCommandError(err, interaction, Discord);
}
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit ce1e26d

Please sign in to comment.