Add reaction-based status feedback for prefix SFX commands
- Implement reaction progression: 🔊 (playing) → ✅ (finished) - Remove permissions-heavy removeAll() call that was causing errors - Add error reaction (❌) for failed sound playback - Fallback to text reply if reactions fail (permission handling) - Maintain clean chat experience with minimal visual feedback Status Flow: - !sfx command starts: 🔊 reaction added - Sound finishes playing: ✅ reaction added (both visible) - Error occurs: ❌ reaction added Now all SFX interfaces provide consistent status feedback: - Prefix: Reaction-based progression - Slash commands: Ephemeral message updates 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -223,6 +223,9 @@ class SFXManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// React with speaker icon to show playing status
|
||||||
|
await message.react('🔊');
|
||||||
|
|
||||||
// Join the voice channel
|
// Join the voice channel
|
||||||
await voiceService.join(message.member.voice.channel);
|
await voiceService.join(message.member.voice.channel);
|
||||||
|
|
||||||
@@ -232,6 +235,9 @@ class SFXManager {
|
|||||||
volume: guildConfig.sfxVolume || 0.5,
|
volume: guildConfig.sfxVolume || 0.5,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Add completion reaction (keep both speaker and checkmark)
|
||||||
|
await message.react('✅');
|
||||||
|
|
||||||
// Leave the voice channel after playing
|
// Leave the voice channel after playing
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
voiceService.leave(message.guild.id);
|
voiceService.leave(message.guild.id);
|
||||||
@@ -241,9 +247,16 @@ class SFXManager {
|
|||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`❌ Error playing SFX '${sfxName}':`, error);
|
console.error(`❌ Error playing SFX '${sfxName}':`, error);
|
||||||
|
|
||||||
|
// Add error reaction
|
||||||
|
try {
|
||||||
|
await message.react('❌');
|
||||||
|
} catch (reactionError) {
|
||||||
|
// If reactions fail, fall back to reply
|
||||||
await message.reply("❌ Couldn't play that sound effect. Make sure I have permission to join your voice channel!");
|
await message.reply("❌ Couldn't play that sound effect. Make sure I have permission to join your voice channel!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = new SFXManager();
|
module.exports = new SFXManager();
|
||||||
Reference in New Issue
Block a user