This repository has been archived by the owner on Jul 15, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
69 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const emoji = require("../../config.json").emojis; | ||
|
||
const blockedSchema = require("../../models/blockedSchema"); | ||
|
||
module.exports = { | ||
name: "blocked-message-info", | ||
startsWith: true, | ||
async execute(interaction, client, Discord) { | ||
try { | ||
const id = interaction.customId.replace("blocked-message-info-", ""); | ||
|
||
if(!await blockedSchema.exists({ _id: id })) { | ||
const error = new Discord.EmbedBuilder() | ||
.setColor(client.config_embeds.error) | ||
.setDescription(`${emoji.error} No message was found with that ID!`) | ||
|
||
await interaction.reply({ embeds: [error], ephemeral: true }); | ||
return; | ||
} | ||
|
||
const data = await blockedSchema.findOne({ _id: id }); | ||
|
||
const info = new Discord.EmbedBuilder() | ||
.setColor(client.config_embeds.default) | ||
.addFields ( | ||
{ name: "💬 Message ID", value: `${data._id}` }, | ||
{ name: "👤 User ID", value: `${data.user}` }, | ||
{ name: "🗄️ Guild ID", value: `${data.guild}` } | ||
) | ||
|
||
await interaction.reply({ embeds: [info], ephemeral: true }); | ||
} catch(err) { | ||
client.logButtonError(err, interaction, Discord); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters