mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2025-07-01 17:43:38 +00:00
Moved funcs
This commit is contained in:
@ -1,20 +0,0 @@
|
||||
module.exports = function (client, msg, command) {
|
||||
let message = {};
|
||||
const radio = client.radio.get(msg.guild.id);
|
||||
const permissions = msg.channel.permissionsFor(msg.author);
|
||||
if (!radio) {
|
||||
msg.channel.send(client.messageEmojis["error"] + client.messages.notPlaying);
|
||||
return false;
|
||||
}
|
||||
if (msg.member.voice.channel !== radio.voiceChannel) {
|
||||
msg.channel.send(client.messageEmojis["error"] + client.messages.wrongVoiceChannel);
|
||||
return false;
|
||||
}
|
||||
if(!command.permission == 'none'){
|
||||
if (!permissions.has(command.permission)) {
|
||||
message.noPerms = client.messages.noPerms.replace("%command.permission%", command.permission);
|
||||
msg.channel.send(client.messageEmojis["error"] + message.noPerms);
|
||||
return false;
|
||||
} else return true;
|
||||
} else return true;
|
||||
};
|
@ -14,10 +14,13 @@ module.exports = class extends Client {
|
||||
this.commands = new Collection();
|
||||
this.commandAliases = new Collection();
|
||||
this.radio = new Map();
|
||||
|
||||
this.funcs = {};
|
||||
this.funcs.check = require('../funcs/check.js');
|
||||
this.funcs.msToTime = require('../funcs/msToTime.js');
|
||||
|
||||
this.config = require('../config.js');
|
||||
this.messages = require('./messages.js');
|
||||
this.funcs.check = require('./check.js');
|
||||
|
||||
const commandFiles = fs.readdirSync(path.join(path.dirname(__dirname), 'commands')).filter(f => f.endsWith('.js'));
|
||||
for (const file of commandFiles) {
|
||||
|
@ -13,7 +13,7 @@ module.exports = {
|
||||
inviteTitle: "Invite %client.user.username% to your Discord server!",
|
||||
listTitle: "Radio Stations",
|
||||
nowplayingTitle: "Now Playing",
|
||||
nowplayingDescription: "**%radio.station.name%** \n Owner: %radio.station.owner% \n %msToTime(completed, \"hh:mm:ss\")%",
|
||||
nowplayingDescription: "**%radio.station.name%** \n Owner: %radio.station.owner% \n %client.funcs.msToTime(completed, \"hh:mm:ss\")%",
|
||||
noVoiceChannel: "You need to be in a voice channel to play radio!",
|
||||
noQuery: "You need to use a number or search for a supported station!",
|
||||
noPermsConnect: "I cannot connect to your voice channel.",
|
||||
|
Reference in New Issue
Block a user