mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2025-07-01 12:23:38 +00:00
removed some unnecessary variables and general clean up
This commit is contained in:
@ -7,13 +7,13 @@ module.exports = {
|
||||
if (!msg.content.startsWith(prefix)) return;
|
||||
if (!args[0]) return;
|
||||
const commandName = args[0].toLowerCase();
|
||||
if (commandName === 'none') return;
|
||||
const command = client.commands.get(commandName) || client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName)) || client.commandAliases.get(commandName);
|
||||
if (!command && msg.content !== `${prefix}`) return;
|
||||
const permissions = msg.channel.permissionsFor(msg.client.user);
|
||||
if (!permissions.has('EMBED_LINKS')) return msg.channel.send(client.messages.noPermsEmbed);
|
||||
try {
|
||||
command.uses++;
|
||||
command.execute(msg, args, client, Discord, prefix, command);
|
||||
command.execute(msg, args, client, Discord, command);
|
||||
} catch (error) {
|
||||
msg.reply(client.messages.runningCommandFailed);
|
||||
console.error(error);
|
||||
|
@ -31,7 +31,7 @@ module.exports = {
|
||||
client.stations = await fetch('https://gitea.cwinfo.org/cwchristerw/radio/raw/branch/master/playlist.json')
|
||||
.then(res => res.json());
|
||||
}, 3600000);
|
||||
|
||||
require(`../struct/emojis.js`).execute(client, Discord);
|
||||
|
||||
require(`../struct/emojis.js`).execute(client);
|
||||
}
|
||||
}
|
@ -7,8 +7,6 @@ module.exports = {
|
||||
if (!radio) return;
|
||||
if (newState.member.id === client.user.id && oldState.member.id === client.user.id) {
|
||||
if (newState.channel === null) {
|
||||
radio.songs = [];
|
||||
radio.looping = false;
|
||||
return client.radio.delete(newState.guild.id);
|
||||
}
|
||||
|
||||
@ -18,8 +16,6 @@ module.exports = {
|
||||
const connection = await oldState.channel.join();
|
||||
return radio.connection = connection;
|
||||
} catch (error) {
|
||||
radio.songs = [];
|
||||
radio.looping = false;
|
||||
radio.connection.dispatcher.destroy();
|
||||
radio.voiceChannel.leave();
|
||||
client.radio.delete(msg.guild.id);
|
||||
@ -36,8 +32,6 @@ module.exports = {
|
||||
setTimeout(() => {
|
||||
if (!radio) return;
|
||||
if (radio.voiceChannel.members.size === 1) {
|
||||
radio.songs = [];
|
||||
radio.looping = false;
|
||||
radio.connection.dispatcher.destroy();
|
||||
radio.voiceChannel.leave();
|
||||
client.radio.delete(newState.guild.id);
|
||||
|
Reference in New Issue
Block a user