mirror of
https://github.com/musix-org/musix-oss
synced 2025-06-16 15:46:00 +00:00
Option handler for playlists and settings. Exe function to execute command files. Command aliases updated.
This commit is contained in:
34
commands/settings/setpremium.js
Normal file
34
commands/settings/setpremium.js
Normal file
@ -0,0 +1,34 @@
|
||||
module.exports = {
|
||||
name: 'setpremium',
|
||||
async execute(message, args, client, Discord, prefix) {
|
||||
if (message.author.id !== client.config.devId) return;
|
||||
if (args[2]) {
|
||||
const guild = client.guilds.get(args[2]);
|
||||
if (!client.global.db.guilds[guild.id].premium) {
|
||||
client.global.db.playlists[guild.id] = {
|
||||
songs: [],
|
||||
firstSong: undefined,
|
||||
saved: false,
|
||||
};
|
||||
client.global.db.guilds[guild.id].premium = true;
|
||||
message.channel.send(`:white_check_mark: Guild ${guild.name} | ${guild.id} is now premium! :tada:`)
|
||||
} else {
|
||||
client.global.db.guilds[guild.id].premium = false;
|
||||
message.channel.send(`:white_check_mark: Guild ${guild.name} | ${guild.id} is no longer premium!`)
|
||||
}
|
||||
} else {
|
||||
if (!client.global.db.guilds[message.guild.id].premium) {
|
||||
client.global.db.playlists[message.guild.id] = {
|
||||
songs: [],
|
||||
firstSong: undefined,
|
||||
saved: false,
|
||||
};
|
||||
client.global.db.guilds[message.guild.id].premium = true;
|
||||
message.channel.send(':white_check_mark: This guild is now premium! :tada:')
|
||||
} else {
|
||||
client.global.db.guilds[message.guild.id].premium = false;
|
||||
message.channel.send(":white_check_mark: This guild is no longer premium!")
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user