mirror of
https://github.com/hazemKrimi/discord-bot.git
synced 2026-05-01 18:30:25 +00:00
added changes to error handling
This commit is contained in:
@@ -11,7 +11,7 @@ module.exports = class Play extends Command {
|
|||||||
guildOnly: true,
|
guildOnly: true,
|
||||||
throttling: {
|
throttling: {
|
||||||
usages: 1,
|
usages: 1,
|
||||||
duration: 5
|
duration: 3
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -38,7 +38,7 @@ module.exports = class Play extends Command {
|
|||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
const embed = new MessageEmbed().setColor('#ff0000').setTitle(':x: Error occured, if you are my creator please fix me soon');
|
const embed = new MessageEmbed().setColor('#ff0000').setTitle(`:x: Error occured: ${err.message}`);
|
||||||
return message.say({ embed });
|
return message.say({ embed });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ module.exports = class Play extends Command {
|
|||||||
guildOnly: true,
|
guildOnly: true,
|
||||||
throttling: {
|
throttling: {
|
||||||
usages: 1,
|
usages: 1,
|
||||||
duration: 5
|
duration: 3
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -39,7 +39,7 @@ module.exports = class Play extends Command {
|
|||||||
}
|
}
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
const embed = new MessageEmbed().setColor('#ff0000').setTitle(':x: Error occured, if you are my creator please fix me soon');
|
const embed = new MessageEmbed().setColor('#ff0000').setTitle(`:x: Error occured: ${err.message}`);
|
||||||
return message.say({ embed });
|
return message.say({ embed });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ module.exports = class Play extends Command {
|
|||||||
guildOnly: true,
|
guildOnly: true,
|
||||||
throttling: {
|
throttling: {
|
||||||
usages: 1,
|
usages: 1,
|
||||||
duration: 5
|
duration: 3
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -35,7 +35,7 @@ module.exports = class Play extends Command {
|
|||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
const embed = new MessageEmbed().setColor('#ff0000').setTitle(':x: Error occured, if you are my creator please fix me soon');
|
const embed = new MessageEmbed().setColor('#ff0000').setTitle(`:x: Error occured: ${err.message}`);
|
||||||
return message.say({ embed });
|
return message.say({ embed });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ module.exports = class Play extends Command {
|
|||||||
guildOnly: true,
|
guildOnly: true,
|
||||||
throttling: {
|
throttling: {
|
||||||
usages: 1,
|
usages: 1,
|
||||||
duration: 5
|
duration: 3
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -33,7 +33,7 @@ module.exports = class Play extends Command {
|
|||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
const embed = new MessageEmbed().setColor('#ff0000').setTitle(':x: Error occured, if you are my creator please fix me soon');
|
const embed = new MessageEmbed().setColor('#ff0000').setTitle(`:x: Error occured: ${err.message}`);
|
||||||
return message.say({ embed });
|
return message.say({ embed });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ module.exports = class Play extends Command {
|
|||||||
guildOnly: true,
|
guildOnly: true,
|
||||||
throttling: {
|
throttling: {
|
||||||
usages: 1,
|
usages: 1,
|
||||||
duration: 5
|
duration: 3
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -28,17 +28,17 @@ module.exports = class Play extends Command {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const voiceChannel = message.member.voice.channel;
|
const voiceChannel = message.member.voice.channel;
|
||||||
message.guild.music.queue = [];
|
|
||||||
message.guild.music.isPlaying = false;
|
message.guild.music.isPlaying = false;
|
||||||
message.guild.music.nowPlaying = null;
|
message.guild.music.nowPlaying = null;
|
||||||
message.guild.music.dispatcher = null;
|
message.guild.music.dispatcher = null;
|
||||||
|
message.guild.music.queue = [];
|
||||||
voiceChannel.leave();
|
voiceChannel.leave();
|
||||||
const embed = new MessageEmbed().setColor('#000099').setTitle(':stop_button: Stopped player and cleared queue');
|
const embed = new MessageEmbed().setColor('#000099').setTitle(':stop_button: Stopped player and cleared queue');
|
||||||
return await message.say({ embed });
|
return await message.say({ embed });
|
||||||
}
|
}
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
const embed = new MessageEmbed().setColor('#ff0000').setTitle(':x: Error occured, if you are my creator please fix me soon');
|
const embed = new MessageEmbed().setColor('#ff0000').setTitle(`:x: Error occured: ${err.message}`);
|
||||||
return message.say({ embed });
|
return message.say({ embed });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user