Fixed audio commands and whisper
This commit is contained in:
		
							parent
							
								
									2cffdf6628
								
							
						
					
					
						commit
						f0f0bff8f3
					
				
					 2 changed files with 6 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -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"];
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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("&", "\\&").replaceAll(">", "\\>").replaceAll("<", "\\<").replaceAll("\"", "\\"").replaceAll("'", "\\'").replaceAll("%", "\\%")
 | 
			
		||||
      caption: newArgs.replaceAll("&", "\\&").replaceAll(">", "\\>").replaceAll("<", "\\<").replaceAll("\"", "\\"").replaceAll("'", "\\'").replaceAll("%", "\\%")
 | 
			
		||||
    };
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue