Added database
This commit is contained in:
23
discordbot/commands/clear.js
Normal file
23
discordbot/commands/clear.js
Normal file
@@ -0,0 +1,23 @@
|
||||
const { SlashCommandBuilder, PermissionFlagsBits } = require('discord.js');
|
||||
const { simpleEmbed } = require('../functions/embeds.js');
|
||||
|
||||
module.exports = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('clear')
|
||||
.setDescription('Clear 1-100 messages')
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.addNumberOption(option => option
|
||||
.setName('amount')
|
||||
.setDescription('The amount of messages to clear')
|
||||
.setRequired(true)),
|
||||
|
||||
async execute(interaction) {
|
||||
const amount = interaction.options.getNumber('amount');
|
||||
|
||||
if (amount < 1 || amount > 100) return await interaction.reply({ embeds: [simpleEmbed('The amount must be between 1-100')] });
|
||||
|
||||
interaction.channel.bulkDelete(amount, true);
|
||||
|
||||
await interaction.reply({ embeds: [simpleEmbed(`Cleared **${amount}** messages`)], ephemeral: true });
|
||||
},
|
||||
};
|
@@ -3,12 +3,12 @@ const { simpleEmbed } = require('../functions/embeds.js');
|
||||
const { client } = require('../index.js');
|
||||
|
||||
module.exports = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('ping')
|
||||
.setDescription('Replies with Pong!'),
|
||||
async execute(interaction) {
|
||||
const reply = await interaction.reply({ embeds: [simpleEmbed(`Websocket heartbeat: **${client.ws.ping}ms**\n Roundtrip latency: **Pinging...**`)], fetchReply: true, emphemeral: true });
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('ping')
|
||||
.setDescription('Replies with Pong!'),
|
||||
async execute(interaction) {
|
||||
const reply = await interaction.reply({ embeds: [simpleEmbed(`Websocket heartbeat: **${client.ws.ping}ms**\n Roundtrip latency: **Pinging...**`)], fetchReply: true, emphemeral: true });
|
||||
|
||||
interaction.editReply({ embeds: [simpleEmbed(`Websocket heartbeat: **${client.ws.ping}ms**\n Roundtrip latency: **${reply.createdTimestamp - interaction.createdTimestamp}ms**`)] });
|
||||
},
|
||||
interaction.editReply({ embeds: [simpleEmbed(`Websocket heartbeat: **${client.ws.ping}ms**\n Roundtrip latency: **${reply.createdTimestamp - interaction.createdTimestamp}ms**`)] });
|
||||
},
|
||||
};
|
||||
|
Reference in New Issue
Block a user