Allow airhorn and dec-talk to work without reaction perms

This commit is contained in:
Dragon Fire
2020-05-05 18:14:07 -04:00
parent 4acebbc514
commit ec779f2a68
3 changed files with 7 additions and 5 deletions
+3 -2
View File
@@ -15,7 +15,6 @@ module.exports = class AirhornCommand extends Command {
duration: 10
},
userPermissions: ['CONNECT', 'SPEAK'],
clientPermissions: ['ADD_REACTIONS', 'READ_MESSAGE_HISTORY'],
credit: [
{
name: 'Discord',
@@ -35,7 +34,9 @@ module.exports = class AirhornCommand extends Command {
}
const airhorn = sounds[Math.floor(Math.random() * sounds.length)];
connection.play(path.join(__dirname, '..', '..', 'assets', 'sounds', 'airhorn', airhorn));
await msg.react('🔉');
if (msg.channel.permissionsFor(this.client.user).has(['ADD_REACTIONS', 'READ_MESSAGE_HISTORY'])) {
await msg.react('🔉');
}
return null;
}
};
+3 -2
View File
@@ -15,7 +15,6 @@ module.exports = class DECTalkCommand extends Command {
duration: 10
},
userPermissions: ['CONNECT', 'SPEAK'],
clientPermissions: ['ADD_REACTIONS', 'READ_MESSAGE_HISTORY'],
credit: [
{
name: 'calzoneman',
@@ -57,7 +56,9 @@ module.exports = class DECTalkCommand extends Command {
.get('http://tts.cyzon.us/tts')
.query({ text });
connection.play(url);
await msg.react('🔉');
if (msg.channel.permissionsFor(this.client.user).has(['ADD_REACTIONS', 'READ_MESSAGE_HISTORY'])) {
await msg.react('🔉');
}
return null;
} catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "114.5.4",
"version": "114.5.5",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {