mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-20 05:51:35 +02:00
Allow airhorn and dec-talk to work without reaction perms
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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
@@ -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": {
|
||||||
|
|||||||
Reference in New Issue
Block a user