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 duration: 10
}, },
userPermissions: ['CONNECT', 'SPEAK'], userPermissions: ['CONNECT', 'SPEAK'],
clientPermissions: ['ADD_REACTIONS', 'READ_MESSAGE_HISTORY'],
credit: [ credit: [
{ {
name: 'Discord', name: 'Discord',
@@ -35,7 +34,9 @@ module.exports = class AirhornCommand extends Command {
} }
const airhorn = sounds[Math.floor(Math.random() * sounds.length)]; const airhorn = sounds[Math.floor(Math.random() * sounds.length)];
connection.play(path.join(__dirname, '..', '..', 'assets', 'sounds', 'airhorn', airhorn)); 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; return null;
} }
}; };
+3 -2
View File
@@ -15,7 +15,6 @@ module.exports = class DECTalkCommand extends Command {
duration: 10 duration: 10
}, },
userPermissions: ['CONNECT', 'SPEAK'], userPermissions: ['CONNECT', 'SPEAK'],
clientPermissions: ['ADD_REACTIONS', 'READ_MESSAGE_HISTORY'],
credit: [ credit: [
{ {
name: 'calzoneman', name: 'calzoneman',
@@ -57,7 +56,9 @@ module.exports = class DECTalkCommand extends Command {
.get('http://tts.cyzon.us/tts') .get('http://tts.cyzon.us/tts')
.query({ text }); .query({ text });
connection.play(url); connection.play(url);
await msg.react('🔉'); if (msg.channel.permissionsFor(this.client.user).has(['ADD_REACTIONS', 'READ_MESSAGE_HISTORY'])) {
await msg.react('🔉');
}
return null; return null;
} catch (err) { } catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "xiao", "name": "xiao",
"version": "114.5.4", "version": "114.5.5",
"description": "Your personal server companion.", "description": "Your personal server companion.",
"main": "Xiao.js", "main": "Xiao.js",
"scripts": { "scripts": {