Added fartreverb, added shuffle, fixed reload error messages, fixed some possible bugs

This commit is contained in:
Essem 2021-09-20 12:26:40 -05:00
parent b07c0e389e
commit 264b59ba59
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
10 changed files with 57 additions and 13 deletions

View file

@ -15,7 +15,7 @@ class ReloadCommand extends Command {
this.ipc.register("reloadFail", (message) => {
this.ipc.unregister("reloadSuccess");
this.ipc.unregister("reloadFail");
resolve(message);
resolve(message.msg.result);
});
});
}

View file

@ -6,7 +6,7 @@ class LoopCommand extends MusicCommand {
if (!this.message.channel.guild) return "This command only works in servers!";
if (!this.message.member.voiceState.channelID) return "You need to be in a voice channel first!";
if (!this.message.channel.guild.members.get(this.client.user.id).voiceState.channelID) return "I'm not in a voice channel!";
if (this.connection.host !== this.message.author.id) return "Only the current voice session host can loop the music!";
if (this.connection.host !== this.message.author.id && !this.message.member.permissions.has("manageChannels")) return "Only the current voice session host can loop the music!";
const object = this.connection;
object.loop = !object.loop;
players.set(this.message.channel.guild.id, object);

View file

@ -5,7 +5,7 @@ class PauseCommand extends MusicCommand {
if (!this.message.channel.guild) return "This command only works in servers!";
if (!this.message.member.voiceState.channelID) return "You need to be in a voice channel first!";
if (!this.message.channel.guild.members.get(this.client.user.id).voiceState.channelID) return "I'm not in a voice channel!";
if (this.connection.host !== this.message.author.id) return "Only the current voice session host can pause/resume the music!";
if (this.connection.host !== this.message.author.id && !this.message.member.permissions.has("manageChannels")) return "Only the current voice session host can pause/resume the music!";
const player = this.connection.player;
player.pause(!player.paused ? true : false);
return `🔊 The player has been ${!player.paused ? "paused" : "resumed"}.`;

20
commands/music/shuffle.js Normal file
View file

@ -0,0 +1,20 @@
import { players } from "../../utils/soundplayer.js";
import MusicCommand from "../../classes/musicCommand.js";
class ShuffleCommand extends MusicCommand {
async run() {
if (!this.message.channel.guild) return "This command only works in servers!";
if (!this.message.member.voiceState.channelID) return "You need to be in a voice channel first!";
if (!this.message.channel.guild.members.get(this.client.user.id).voiceState.channelID) return "I'm not in a voice channel!";
if (this.connection.host !== this.message.author.id) return "Only the current voice session host can shuffle the music!";
const object = this.connection;
object.shuffle = !object.shuffle;
players.set(this.message.channel.guild.id, object);
return object.shuffle ? "🔊 The player is now shuffling." : "🔊 The player is no longer shuffling.";
}
static description = "Shuffles the music";
static aliases = ["toggleshuffle"];
}
export default ShuffleCommand;

View file

@ -6,7 +6,7 @@ class StopCommand extends MusicCommand {
if (!this.message.channel.guild) return "This command only works in servers!";
if (!this.message.member.voiceState.channelID) return "You need to be in a voice channel first!";
if (!this.message.channel.guild.members.get(this.client.user.id).voiceState.channelID) return "I'm not in a voice channel!";
if (this.connection.host !== this.message.author.id) return "Only the current voice session host can stop the music!";
if (this.connection.host !== this.message.author.id && !this.message.member.permissions.has("manageChannels")) return "Only the current voice session host can stop the music!";
manager.leave(this.message.channel.guild.id);
const connection = this.connection.player;
connection.destroy();

View file

@ -0,0 +1,14 @@
// shoutouts to dairyorange, you're a real one
import { play } from "../../utils/soundplayer.js";
import MusicCommand from "../../classes/musicCommand.js";
class FartReverbCommand extends MusicCommand {
async run() {
return await play(this.client, "./assets/audio/fart2.ogg", this.message);
}
static description = "Plays a fart sound effect with extra reverb";
static aliases = ["fart2"];
}
export default FartReverbCommand;