mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-24 02:15:10 +02:00
Add Reactions to Soundboard
This commit is contained in:
@@ -19,8 +19,8 @@ class SoundBoardCommand extends commando.Command {
|
|||||||
}
|
}
|
||||||
console.log("[Command] " + message.content);
|
console.log("[Command] " + message.content);
|
||||||
if(message.channel.type !== 'dm') {
|
if(message.channel.type !== 'dm') {
|
||||||
if(!message.channel.permissionsFor(this.client.user).hasPermission(['CONNECT', 'SPEAK'])) {
|
if(!message.channel.permissionsFor(this.client.user).hasPermission(['CONNECT', 'SPEAK', 'ADD_REACTIONS'])) {
|
||||||
message.channel.send(':x: Error! In order to do this command, you must give me the permissions to "Connect" and "Speak"!');
|
message.channel.send(':x: Error! In order to do this command, you must give me the permissions to "Connect" and "Speak", as well as the permission to Add Reactions!');
|
||||||
} else {
|
} else {
|
||||||
let voiceChannel = message.member.voiceChannel;
|
let voiceChannel = message.member.voiceChannel;
|
||||||
if (!voiceChannel) {
|
if (!voiceChannel) {
|
||||||
@@ -43,8 +43,10 @@ class SoundBoardCommand extends commando.Command {
|
|||||||
voiceChannel.join().then(connnection => {
|
voiceChannel.join().then(connnection => {
|
||||||
let stream = sounds.paths[soundToPlay];
|
let stream = sounds.paths[soundToPlay];
|
||||||
let dispatcher = connnection.playStream(stream);
|
let dispatcher = connnection.playStream(stream);
|
||||||
|
message.react('🔊');
|
||||||
dispatcher.on('end', () => {
|
dispatcher.on('end', () => {
|
||||||
voiceChannel.leave();
|
voiceChannel.leave();
|
||||||
|
message.react('✅');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user