diff --git a/src/commands/servers/setup.js b/src/commands/servers/setup.js index d95ab67..b384e80 100644 --- a/src/commands/servers/setup.js +++ b/src/commands/servers/setup.js @@ -15,8 +15,19 @@ module.exports = { async execute(interaction) { var channel = interaction.options.getChannel("channel"); - console.log(channel); - - await interaction.reply('Pong!'); + interaction.client.database.search("xan.guilds" , { + serverId : interaction.guild.id + } , async (data) => { + if(data == null){ + interaction.client.database.insert("xan.guilds" , { + serverId : interaction.guild.id, + channelId : channel.id + }, async (c) => { + await interaction.reply(`Saved Channel as #${channel.name} in Database`); + }) + }else{ + await interaction.reply(`Guild is already saved into Database`); + } + }); }, }; \ No newline at end of file