Fixed events, removed debug messages

This commit is contained in:
Ladislav Hano 2023-03-01 10:02:49 +01:00
parent 74a8ae6e81
commit 1c0d97687c
2 changed files with 6 additions and 9 deletions

View file

@ -25,7 +25,7 @@ module.exports = {
option.setName('global') option.setName('global')
.setDescription('Should this event display on all servers?')) .setDescription('Should this event display on all servers?'))
.addStringOption(option => .addStringOption(option =>
option.setName('special message') option.setName('message')
.setDescription('Special message to send in event announcement'))) .setDescription('Special message to send in event announcement')))
.addSubcommand(subcommand => .addSubcommand(subcommand =>
subcommand.setName('delete') subcommand.setName('delete')
@ -54,17 +54,17 @@ module.exports = {
subcommand.setName('name') subcommand.setName('name')
.setDescription('Change name of an event') .setDescription('Change name of an event')
.addStringOption(option => .addStringOption(option =>
option.setName('new name') option.setName('name')
.setDescription('New name of the event') .setDescription('New name of the event')
.setRequired(true)) .setRequired(true))
.addIntegerOption(option => option.setName('id') .addIntegerOption(option => option.setName('id')
.setDescription('Id of the even you want to change') .setDescription('Id of the even you want to change')
.setRequired(true))) .setRequired(true)))
.addSubcommand(subcommand => .addSubcommand(subcommand =>
subcommand.setName('special message') subcommand.setName('message')
.setDescription('Change special message of an event') .setDescription('Change special message of an event')
.addStringOption(option => .addStringOption(option =>
option.setName('new message') option.setName('message')
.setDescription('New special message') .setDescription('New special message')
.setRequired(true)))) .setRequired(true))))
.addSubcommand(subcommand => .addSubcommand(subcommand =>
@ -105,7 +105,7 @@ module.exports = {
case 'name': case 'name':
await interaction.reply(await changeEventName(interaction)); await interaction.reply(await changeEventName(interaction));
break; break;
case 'special message': case 'message':
await interaction.reply(await changeSpecialMessage(interaction)); await interaction.reply(await changeSpecialMessage(interaction));
break; break;
} }
@ -243,7 +243,7 @@ async function changeSpecialMessage(interaction) {
try { try {
await eModel.findOneAndUpdate( await eModel.findOneAndUpdate(
{ id: interaction.options.getInteger('id') }, { id: interaction.options.getInteger('id') },
{ $set: { specialMessage: interaction.options.getString('special message') } }, { $set: { specialMessage: interaction.options.getString('message') } },
); );
} }
catch { catch {

View file

@ -70,9 +70,6 @@ client.once('ready', async () => {
ping(); ping();
}); });
await dbConnect(); await dbConnect();
const a = require('./.debug.js');
a();
console.log('Running!'); console.log('Running!');
}); });