update/configurable server name in welcome message

This commit is contained in:
SowinskiBraeden committed 2024-01-27 15:34:48 -08:00
1 parent dfe384c9b8
commit 639a2ecbb4
4 files changed
+33 -2

No files matched your search

+26
View File
@@ -364,6 +364,19 @@ module.exports = {
required: true,
}]
},
{
name: "welcome_message_server_name",
description: "Configure the server name in the welcome message",
value: "welcome_message_server_name",
type: CommandOptions.SubCommand,
options: [{
name: "name",
desciption: "Server name to include in welcome message",
value: "name",
type: CommandOptions.String,
required: true,
}]
}
],
SlashCommand: {
/**
@@ -787,6 +800,19 @@ module.exports = {
}
case 'welcome_message_server_name':
const server_name = args[0].options[0].value;
client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID},{$set: {"server.serverName":server_name}}, (err, res) => {
if (err) return client.sendInternalError(interacion, err);
});
const succcessUpdateServerName = new EmbedBuilder()
.setDescription(`Successfully configured the server name to **${server_name}** in the welcome message.`)
.setColor(client.config.Colors.Green);
return interaction.send({ embeds: [succcessUpdateServerName] });
default:
return client.sendInternalError(interaction, 'There was an error parsing the config command');
}