mirror of
https://github.com/System-End/Discord-Bot.git
synced 2026-04-19 18:35:22 +00:00
45 lines
1.3 KiB
JavaScript
45 lines
1.3 KiB
JavaScript
const Discord = require('discord.js');
|
|
|
|
const Schema = require("../../database/models/stats");
|
|
|
|
module.exports = async (client, interaction, args) => {
|
|
var channelName = await client.getTemplate(interaction.guild);
|
|
channelName = channelName.replace(`{emoji}`, "💎")
|
|
channelName = channelName.replace(`{name}`, `Boosts: ${interaction.guild.premiumSubscriptionCount || '0'}`)
|
|
|
|
interaction.guild.channels.create({
|
|
name: channelName,
|
|
type: Discord.ChannelType.GuildVoice, permissionOverwrites: [
|
|
{
|
|
deny: [Discord.PermissionsBitField.Flags.Connect],
|
|
id: interaction.guild.id
|
|
},
|
|
],
|
|
}).then(async (channel) => {
|
|
Schema.findOne({ Guild: interaction.guild.id }, async (err, data) => {
|
|
if (data) {
|
|
data.Boost = channel.id;
|
|
data.save();
|
|
}
|
|
else {
|
|
new Schema({
|
|
Guild: interaction.guild.id,
|
|
Boost: channel.id
|
|
}).save();
|
|
}
|
|
})
|
|
|
|
client.succNormal({
|
|
text: `Boost count created!`,
|
|
fields: [
|
|
{
|
|
name: `📘┆Channel`,
|
|
value: `${channel}`
|
|
}
|
|
],
|
|
type: 'editreply'
|
|
}, interaction);
|
|
})
|
|
|
|
}
|
|
|