update/configurable server name in welcome message
This commit is contained in:
4 files changed
+33
-2
No files matched your search
@@ -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');
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user