Fixed audio commands and whisper

This commit is contained in:
Essem 2022-03-31 13:47:22 -05:00
parent 2cffdf6628
commit f0f0bff8f3
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
2 changed files with 6 additions and 4 deletions

View file

@ -4,8 +4,10 @@ import { players, queues } from "../utils/soundplayer.js";
class MusicCommand extends Command {
constructor(client, cluster, worker, ipc, options) {
super(client, cluster, worker, ipc, options);
this.connection = players.get(options.message.channel.guild.id);
this.queue = queues.get(options.message.channel.guild.id);
if (this.channel) {
this.connection = players.get(this.channel.guild.id);
this.queue = queues.get(this.channel.guild.id);
}
}
static requires = ["sound"];

View file

@ -2,9 +2,9 @@ import ImageCommand from "../../classes/imageCommand.js";
class WhisperCommand extends ImageCommand {
params(url) {
const newArgs = this.args.filter(item => !item.includes(url));
const newArgs = this.type === "classic" ? this.args.filter(item => !item.includes(url)).join(" ") : this.options.text;
return {
caption: newArgs.join(" ").replaceAll("&", "\\&amp;").replaceAll(">", "\\&gt;").replaceAll("<", "\\&lt;").replaceAll("\"", "\\&quot;").replaceAll("'", "\\&apos;").replaceAll("%", "\\%")
caption: newArgs.replaceAll("&", "\\&amp;").replaceAll(">", "\\&gt;").replaceAll("<", "\\&lt;").replaceAll("\"", "\\&quot;").replaceAll("'", "\\&apos;").replaceAll("%", "\\%")
};
}