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

Commit

Permalink
feat: remove /message + update cmds desc
Browse files Browse the repository at this point in the history
  • Loading branch information
wdhdev committed Jun 28, 2023
1 parent db138dc commit 59c6ecc
Show file tree
Hide file tree
Showing 12 changed files with 106 additions and 236 deletions.
18 changes: 9 additions & 9 deletions src/commands/dev/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = {
{
type: 1,
name: "add",
description: "Promote a user to a developer.",
description: "[OWNER ONLY] Promote a user to a developer.",
options: [
{
type: 6,
Expand All @@ -31,7 +31,7 @@ module.exports = {
{
type: 1,
name: "remove",
description: "Demote a user from a developer.",
description: "[OWNER ONLY] Demote a user from a developer.",
options: [
{
type: 6,
Expand All @@ -52,7 +52,7 @@ module.exports = {
{
type: 1,
name: "add",
description: "Promote a user to a moderator.",
description: "[DEVELOPER ONLY] Promote a user to a moderator.",
options: [
{
type: 6,
Expand All @@ -66,7 +66,7 @@ module.exports = {
{
type: 1,
name: "remove",
description: "Demote a user from a moderator.",
description: "[DEVELOPER ONLY] Demote a user from a moderator.",
options: [
{
type: 6,
Expand All @@ -82,7 +82,7 @@ module.exports = {
{
type: 1,
name: "send-appeal-menu",
description: "Send the appeal menu to a specified channel.",
description: "[DEVELOPER ONLY] Send the appeal menu to a specified channel.",
options: [
{
type: 7,
Expand All @@ -97,7 +97,7 @@ module.exports = {
{
type: 1,
name: "send-to-do-list",
description: "Send the To-Do List to a specified channel.",
description: "[DEVELOPER ONLY] Send the To-Do List to a specified channel.",
options: [
{
type: 7,
Expand All @@ -112,7 +112,7 @@ module.exports = {
{
type: 1,
name: "unverify",
description: "Unverify a user.",
description: "[DEVELOPER ONLY] Unverify a user.",
options: [
{
type: 6,
Expand All @@ -126,14 +126,14 @@ module.exports = {
{
type: 1,
name: "verified",
description: "Get a list of all the verified users.",
description: "[DEVELOPER ONLY] Get a list of all the verified users.",
options: []
},

{
type: 1,
name: "verify",
description: "Verify a user.",
description: "[DEVELOPER ONLY] Verify a user.",
options: [
{
type: 6,
Expand Down
2 changes: 1 addition & 1 deletion src/commands/dev/announcements.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const devSchema = require("../../models/devSchema");

module.exports = {
name: "announcements",
description: "Manage the announcement system.",
description: "[DEVELOPER ONLY] Manage the announcement system.",
options: [],
default_member_permissions: null,
botPermissions: [],
Expand Down
4 changes: 2 additions & 2 deletions src/commands/dev/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
{
type: 1,
name: "cleanup",
description: "Clean up a specific collection in the database.",
description: "[DEVELOPER ONLY] Clean up a specific collection in the database.",
options: [
{
type: 3,
Expand Down Expand Up @@ -43,7 +43,7 @@ module.exports = {
{
type: 1,
name: "reconnect",
description: "Reconnect the bot to the database.",
description: "[DEVELOPER ONLY] Reconnect the bot to the database.",
options: []
}
],
Expand Down
2 changes: 1 addition & 1 deletion src/commands/dev/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
{
type: 1,
name: "errors",
description: "Get all unresolved errors on Sentry.",
description: "[DEVELOPER ONLY] Get all unresolved errors on Sentry.",
options: []
}
],
Expand Down
2 changes: 1 addition & 1 deletion src/commands/dev/eval.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const emoji = require("../../config.json").emojis;

module.exports = {
name: "eval",
description: "Evaluate code on the bot.",
description: "[DEVELOPER ONLY] Evaluate code on the bot.",
options: [
{
type: 3,
Expand Down
4 changes: 2 additions & 2 deletions src/commands/mod/appeal.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
{
type: 1,
name: "delete",
description: "Delete an appeal.",
description: "[MODERATOR ONLY] Delete an appeal.",
options: [
{
type: 3,
Expand All @@ -28,7 +28,7 @@ module.exports = {
{
type: 1,
name: "get",
description: "Get information about an appeal.",
description: "[MODERATOR ONLY] Get information about an appeal.",
options: [
{
type: 3,
Expand Down
2 changes: 1 addition & 1 deletion src/commands/mod/appeals.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const modSchema = require("../../models/modSchema");

module.exports = {
name: "appeals",
description: "Get all appeals related to a user.",
description: "[MODERATOR ONLY] Get all appeals related to a user.",
options: [
{
type: 6,
Expand Down
83 changes: 36 additions & 47 deletions src/commands/mod/ban.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,21 @@ module.exports = {
{
type: 2,
name: "info",
description: "Get information about a ban.",
description: "[MODERATOR ONLY] Get information about a user's ban.",
options: [
{
type: 1,
type: 6,
name: "user",
description: "Get information about a user's ban.",
options: [
{
type: 6,
name: "user",
description: "The user who's ban information to get.",
required: true
}
]
description: "The user who's ban information to get.",
required: true
}
]
},

{
type: 1,
name: "user",
description: "Ban a user.",
description: "[MODERATOR ONLY] Ban a user.",
options: [
{
type: 6,
Expand Down Expand Up @@ -80,44 +73,40 @@ module.exports = {
}

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

if(!await bannedUserSchema.exists({ _id: user.id })) {
const error = new Discord.EmbedBuilder()
.setColor(client.config_embeds.error)
.setDescription(`${emoji.error} ${user} is not banned!`)

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

const data = await bannedUserSchema.findOne({ _id: user.id });

if(!data.timestamp || !data.reason || !data.mod) {
const error = new Discord.EmbedBuilder()
.setColor(client.config_embeds.error)
.setDescription(`${emoji.error} No information is available about this ban!`)

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

const banInfo = new Discord.EmbedBuilder()
.setColor(client.config_embeds.default)
.setAuthor({ name: user.tag.endsWith("#0") ? `@${user.username}` : user.tag, iconURL: user.displayAvatarURL({ format: "png", dynamic: true }), url: `https://discord.com/users/${user.id}` })
.setTitle("Ban Information")
.addFields (
{ name: "🕰️ Timestamp", value: `<t:${data.timestamp.slice(0, -3)}>` },
{ name: "❓ Reason", value: `${data.reason}` },
{ name: "📜 Appealable", value: data.allowAppeal ? "✅" : "❌" },
{ name: "🔨 Moderator", value: `<@${data.mod}>` }
)

await interaction.editReply({ embeds: [banInfo] });
const user = interaction.options.getUser("user");

if(!await bannedUserSchema.exists({ _id: user.id })) {
const error = new Discord.EmbedBuilder()
.setColor(client.config_embeds.error)
.setDescription(`${emoji.error} ${user} is not banned!`)

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

const data = await bannedUserSchema.findOne({ _id: user.id });

if(!data.timestamp || !data.reason || !data.mod) {
const error = new Discord.EmbedBuilder()
.setColor(client.config_embeds.error)
.setDescription(`${emoji.error} No information is available about this ban!`)

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

const banInfo = new Discord.EmbedBuilder()
.setColor(client.config_embeds.default)
.setAuthor({ name: user.tag.endsWith("#0") ? `@${user.username}` : user.tag, iconURL: user.displayAvatarURL({ format: "png", dynamic: true }), url: `https://discord.com/users/${user.id}` })
.setTitle("Ban Information")
.addFields (
{ name: "🕰️ Timestamp", value: `<t:${data.timestamp.slice(0, -3)}>` },
{ name: "❓ Reason", value: `${data.reason}` },
{ name: "📜 Appealable", value: data.allowAppeal ? "✅" : "❌" },
{ name: "🔨 Moderator", value: `<@${data.mod}>` }
)

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

Expand Down
6 changes: 3 additions & 3 deletions src/commands/mod/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = {
{
type: 1,
name: "add",
description: "Add a word to a filter.",
description: "[MODERATOR ONLY] Add a word to a filter.",
options: [
{
type: 3,
Expand Down Expand Up @@ -47,7 +47,7 @@ module.exports = {
{
type: 1,
name: "list",
description: "Get a list of the words on a filter.",
description: "[MODERATOR ONLY] Get a list of the words on a filter.",
options: [
{
type: 3,
Expand All @@ -74,7 +74,7 @@ module.exports = {
{
type: 1,
name: "remove",
description: "Remove a word from a filter.",
description: "[MODERATOR ONLY] Remove a word from a filter.",
options: [
{
type: 3,
Expand Down
108 changes: 0 additions & 108 deletions src/commands/mod/message.js

This file was deleted.

Loading

0 comments on commit 59c6ecc

Please sign in to comment.