Made messages ephemeral and fixed the category

pull/1/head
Supositware 2 years ago
parent 850a6fb827
commit 2b1f5e4d07

@ -5,7 +5,7 @@ export default {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName('autoresponse') .setName('autoresponse')
.setDescription('Enable or disable autoresponse'), .setDescription('Enable or disable autoresponse'),
category: 'utility', category: 'admin',
userPermissions: [PermissionFlagsBits.ManageMessages], userPermissions: [PermissionFlagsBits.ManageMessages],
async execute(interaction, args, client) { async execute(interaction, args, client) {
const autoresponseStat = await db.autoresponseStat.findOne({ where: { serverID: interaction.guild.id } }); const autoresponseStat = await db.autoresponseStat.findOne({ where: { serverID: interaction.guild.id } });
@ -13,7 +13,7 @@ export default {
if (autoresponseStat.stat !== 'enable') { if (autoresponseStat.stat !== 'enable') {
const body = { serverID: interaction.guild.id, stat: 'enable' }; const body = { serverID: interaction.guild.id, stat: 'enable' };
await db.autoresponseStat.create(body); await db.autoresponseStat.create(body);
return await interaction.reply({ content: 'Autoresponse has been enabled.' }); return await interaction.reply({ content: 'Autoresponse has been enabled.', ephemeral: true });
} }
const row = new ActionRowBuilder() const row = new ActionRowBuilder()
@ -30,7 +30,7 @@ export default {
.setStyle(ButtonStyle.Danger), .setStyle(ButtonStyle.Danger),
); );
await interaction.reply({ content: 'Autoresponse is already enabled, do you wish to disable it?', components: [row] }); await interaction.reply({ content: 'Autoresponse is already enabled, do you wish to disable it?', components: [row], ephemeral: true });
client.once('interactionCreate', async (interactionMenu) => { client.once('interactionCreate', async (interactionMenu) => {
if (!interactionMenu.isButton) return; if (!interactionMenu.isButton) return;
@ -38,10 +38,10 @@ export default {
if (interactionMenu.customId === 'yes') { if (interactionMenu.customId === 'yes') {
const body = { serverID: interaction.guild.id, stat: 'disable' }; const body = { serverID: interaction.guild.id, stat: 'disable' };
await db.autoresponseStat.update(body, { where: { serverID: interaction.guild.id } }); await db.autoresponseStat.update(body, { where: { serverID: interaction.guild.id } });
return interaction.editReply('Auto response has been disabled.'); return interaction.editReply({ content: 'Auto response has been disabled.', ephemeral: true });
} }
else { else {
return interaction.editReply('Nothing has been changed.'); return interaction.editReply({ content: 'Nothing has been changed.', ephemeral: true });
} }
}); });
}, },

@ -5,7 +5,7 @@ export default {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName('quotation') .setName('quotation')
.setDescription('Enable or disable quotations'), .setDescription('Enable or disable quotations'),
category: 'utility', category: 'admin',
userPermissions: [PermissionFlagsBits.ManageMessages], userPermissions: [PermissionFlagsBits.ManageMessages],
async execute(interaction, args, client) { async execute(interaction, args, client) {
const quotationstat = await db.quotationstat.findOne({ where: { serverID: interaction.guild.id } }); const quotationstat = await db.quotationstat.findOne({ where: { serverID: interaction.guild.id } });
@ -13,7 +13,7 @@ export default {
if (quotationstat.stat !== 'enable') { if (quotationstat.stat !== 'enable') {
const body = { serverID: interaction.guild.id, stat: 'enable' }; const body = { serverID: interaction.guild.id, stat: 'enable' };
await db.quotationstat.create(body); await db.quotationstat.create(body);
return await interaction.reply({ content: 'Quotation has been enabled.' }); return await interaction.reply({ content: 'Quotation has been enabled.', ephemeral: true });
} }
const row = new ActionRowBuilder() const row = new ActionRowBuilder()
@ -30,7 +30,7 @@ export default {
.setStyle(ButtonStyle.Danger), .setStyle(ButtonStyle.Danger),
); );
await interaction.reply({ content: 'Quotation is already enabled, do you wish to disable it?', components: [row] }); await interaction.reply({ content: 'Quotation is already enabled, do you wish to disable it?', components: [row], ephemeral: true });
client.once('interactionCreate', async (interactionMenu) => { client.once('interactionCreate', async (interactionMenu) => {
if (!interactionMenu.isButton) return; if (!interactionMenu.isButton) return;
@ -38,10 +38,10 @@ export default {
if (interactionMenu.customId === 'yes') { if (interactionMenu.customId === 'yes') {
const body = { serverID: interaction.guild.id, stat: 'disable' }; const body = { serverID: interaction.guild.id, stat: 'disable' };
await db.quotationstat.update(body, { where: { serverID: interaction.guild.id } }); await db.quotationstat.update(body, { where: { serverID: interaction.guild.id } });
return interaction.editReply('Quotation has been disabled.'); return interaction.editReply({ content: 'Quotation has been disabled.', ephemeral: true });
} }
else { else {
return interaction.editReply('Nothing has been changed.'); return interaction.editReply({ content: 'Nothing has been changed.', ephemeral: true });
} }
}); });
}, },

Loading…
Cancel
Save