fixing style + an error
This commit is contained in:
		
							parent
							
								
									9ab8731f90
								
							
						
					
					
						commit
						e73301f87d
					
				
					 6 changed files with 33 additions and 33 deletions
				
			
		| 
						 | 
					@ -17,6 +17,7 @@ exports.help = {
 | 
				
			||||||
  parameters: '`question` - the question you want to ask'
 | 
					  parameters: '`question` - the question you want to ask'
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// eslint-disable-next-line no-unused-vars
 | 
				
			||||||
const responses = require('../assets/json/8ball.json').responses
 | 
					const responses = require('../assets/json/8ball.json').responses
 | 
				
			||||||
exports.run = async (client, message, args, level, data) => {
 | 
					exports.run = async (client, message, args, level, data) => {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -12,7 +12,7 @@ exports.conf = {
 | 
				
			||||||
exports.help = {
 | 
					exports.help = {
 | 
				
			||||||
  name: 'movehere',
 | 
					  name: 'movehere',
 | 
				
			||||||
  category: 'Music',
 | 
					  category: 'Music',
 | 
				
			||||||
  description: 'Moves ' + client.config.botName + ' into your voice channel and/or text channel.',
 | 
					  description: 'Moves the bot into your voice channel and/or text channel.',
 | 
				
			||||||
  usage: 'movehere',
 | 
					  usage: 'movehere',
 | 
				
			||||||
  parameters: ''
 | 
					  parameters: ''
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -20,16 +20,16 @@ exports.help = {
 | 
				
			||||||
const music = require('../utils/music')
 | 
					const music = require('../utils/music')
 | 
				
			||||||
exports.run = async (client, message, args, level, data) => {
 | 
					exports.run = async (client, message, args, level, data) => {
 | 
				
			||||||
  // get guild music data
 | 
					  // get guild music data
 | 
				
			||||||
  let mGuild = music.getGuild(message.guild.id)
 | 
					  const mGuild = music.getGuild(message.guild.id)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if(!mGuild.playing) {
 | 
					  if (!mGuild.playing) {
 | 
				
			||||||
    return message.channel.send('<:error:466995152976871434> Nothing is playing.')
 | 
					    return message.channel.send('<:error:466995152976871434> Nothing is playing.')
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // change text channel
 | 
					  // change text channel
 | 
				
			||||||
  let textChannelChanged = false
 | 
					  let textChannelChanged = false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if(mGuild.channel.id != message.channel.id) {
 | 
					  if (mGuild.channel.id !== message.channel.id) {
 | 
				
			||||||
    mGuild.channel = message.channel
 | 
					    mGuild.channel = message.channel
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    textChannelChanged = true
 | 
					    textChannelChanged = true
 | 
				
			||||||
| 
						 | 
					@ -38,18 +38,18 @@ exports.run = async (client, message, args, level, data) => {
 | 
				
			||||||
  // move to another voice channel
 | 
					  // move to another voice channel
 | 
				
			||||||
  let voiceChannelMoved = false
 | 
					  let voiceChannelMoved = false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if(message.voice.channel && mGuild.voiceChannel && (message.voice.channel != mGuild.voiceChannel.id)) {
 | 
					  if (message.voice.channel && mGuild.voiceChannel && (message.voice.channel !== mGuild.voiceChannel.id)) {
 | 
				
			||||||
    // TODO: this
 | 
					    // TODO: this
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    voiceChannelMoved = true
 | 
					    voiceChannelMoved = true
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // response
 | 
					  // response
 | 
				
			||||||
  if(textChannelChanged && voiceChannelMoved) {
 | 
					  if (textChannelChanged && voiceChannelMoved) {
 | 
				
			||||||
    return message.channel.send('<:success:466995111885144095> Music playback moved to your voice channel and music messages to your text channel.')
 | 
					    return message.channel.send('<:success:466995111885144095> Music playback moved to your voice channel and music messages to your text channel.')
 | 
				
			||||||
  } else if(textChannelChanged) {
 | 
					  } else if (textChannelChanged) {
 | 
				
			||||||
    return message.channel.send('<:success:466995111885144095> Music module will send messages to your text channel.')
 | 
					    return message.channel.send('<:success:466995111885144095> Music module will send messages to your text channel.')
 | 
				
			||||||
  } else if(voiceChannelMoved) {
 | 
					  } else if (voiceChannelMoved) {
 | 
				
			||||||
    return message.channel.send('<:success:466995111885144095> Music playback moved to your voice channel.')
 | 
					    return message.channel.send('<:success:466995111885144095> Music playback moved to your voice channel.')
 | 
				
			||||||
  } else {
 | 
					  } else {
 | 
				
			||||||
    return message.channel.send('<:error:466995152976871434> Music is already playing in your voice channel!')
 | 
					    return message.channel.send('<:error:466995152976871434> Music is already playing in your voice channel!')
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,24 +1,24 @@
 | 
				
			||||||
exports.conf = {
 | 
					exports.conf = {
 | 
				
			||||||
    enabled: true,
 | 
					  enabled: true,
 | 
				
			||||||
    guildOnly: false,
 | 
					  guildOnly: false,
 | 
				
			||||||
    aliases: [],
 | 
					  aliases: [],
 | 
				
			||||||
    permLevel: 'Developer',
 | 
					  permLevel: 'Developer',
 | 
				
			||||||
    requiredPerms: [],
 | 
					  requiredPerms: [],
 | 
				
			||||||
    cooldown: 2000
 | 
					  cooldown: 2000
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
exports.help = {
 | 
					exports.help = {
 | 
				
			||||||
    name: 'restart',
 | 
					  name: 'restart',
 | 
				
			||||||
    category: 'Developer',
 | 
					  category: 'Developer',
 | 
				
			||||||
    description: 'Restarts the bot.',
 | 
					  description: 'Restarts the bot.',
 | 
				
			||||||
    usage: 'restart',
 | 
					  usage: 'restart',
 | 
				
			||||||
    parameters: ''
 | 
					  parameters: ''
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
exports.run = async (client, message) => {// eslint-disable-line no-unused-vars
 | 
					exports.run = async (client, message) => { // eslint-disable-line no-unused-vars
 | 
				
			||||||
  // This actually shuts down the bot, you'll need to use something like pm2 to get it to restart
 | 
					  // This actually shuts down the bot, you'll need to use something like pm2 to get it to restart
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  await message.channel.send("<:reboot:467216876938985482> Restarting...");
 | 
					  await message.channel.send('<:reboot:467216876938985482> Restarting...')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /*
 | 
					  /*
 | 
				
			||||||
  client.commands.forEach( async cmd => {
 | 
					  client.commands.forEach( async cmd => {
 | 
				
			||||||
| 
						 | 
					@ -26,5 +26,5 @@ exports.run = async (client, message) => {// eslint-disable-line no-unused-vars
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
  */
 | 
					  */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  process.exit(1);
 | 
					  process.exit(1)
 | 
				
			||||||
};
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -21,15 +21,15 @@ const { setVolume } = require('../utils/music')
 | 
				
			||||||
exports.run = async (client, message, args, level, data) => {
 | 
					exports.run = async (client, message, args, level, data) => {
 | 
				
			||||||
  let userVolume = args[0]
 | 
					  let userVolume = args[0]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (vol) {
 | 
					  if (userVolume) {
 | 
				
			||||||
    userVolume = Number(vol)
 | 
					    userVolume = Number(userVolume)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    let vol = userVolume / 100 * 0.25
 | 
					    userVolume = userVolume / 100 * 0.25
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (vol <= 1) {
 | 
					    if (userVolume <= 1) {
 | 
				
			||||||
      setVolume(message.guild, vol)
 | 
					      setVolume(message.guild, userVolume)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      message.reply('set volume to ' + userVolume * 100 + '%')
 | 
					      message.reply('<:success:466995111885144095> Set volume to ' + userVolume * 100 + '%')
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -11,7 +11,7 @@ const config = {
 | 
				
			||||||
    enabled: false, // enable auto-update
 | 
					    enabled: false, // enable auto-update
 | 
				
			||||||
    branch: 'next', // git branch
 | 
					    branch: 'next', // git branch
 | 
				
			||||||
    autoFetch: false, // check if an update is available and automatically restart and update
 | 
					    autoFetch: false, // check if an update is available and automatically restart and update
 | 
				
			||||||
    fetchInterval: 60000, // auto-fetch interval in milliseconds
 | 
					    fetchInterval: 60000 // auto-fetch interval in milliseconds
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // API keys that are required for some features/commands
 | 
					  // API keys that are required for some features/commands
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										5
									
								
								index.js
									
										
									
									
									
								
							
							
						
						
									
										5
									
								
								index.js
									
										
									
									
									
								
							| 
						 | 
					@ -29,10 +29,9 @@ client.logger = require('./utils/logger')
 | 
				
			||||||
require('./utils/_functions')(client)
 | 
					require('./utils/_functions')(client)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Set missing values in config from config template
 | 
					// Set missing values in config from config template
 | 
				
			||||||
for(let c in client.configTemplate) {
 | 
					for (const c in client.configTemplate) {
 | 
				
			||||||
  if(typeof client.config[c] == 'undefined') {
 | 
					  if (typeof client.config[c] === 'undefined') {
 | 
				
			||||||
    client.logger.warn('Config value missing: ' + String(c))
 | 
					    client.logger.warn('Config value missing: ' + String(c))
 | 
				
			||||||
 | 
					 | 
				
			||||||
    client.config[c] = client.configTemplate[c]
 | 
					    client.config[c] = client.configTemplate[c]
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue