music: fix urls not working
This commit is contained in:
		
							parent
							
								
									07eacf747b
								
							
						
					
					
						commit
						29b13b3d1f
					
				
					 1 changed files with 3 additions and 2 deletions
				
			
		| 
						 | 
					@ -423,11 +423,12 @@ command.usage = "help";
 | 
				
			||||||
command.callback = async function (
 | 
					command.callback = async function (
 | 
				
			||||||
  msg,
 | 
					  msg,
 | 
				
			||||||
  line,
 | 
					  line,
 | 
				
			||||||
  [subcommand, ...args],
 | 
					  args,
 | 
				
			||||||
  {shuffle = false, limit = -1, offset = 0, next = false}
 | 
					  {shuffle = false, limit = -1, offset = 0, next = false}
 | 
				
			||||||
) {
 | 
					) {
 | 
				
			||||||
  if (!msg.guildID) return "This command can only be used in guilds.";
 | 
					  if (!msg.guildID) return "This command can only be used in guilds.";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const subcommand = args.shift();
 | 
				
			||||||
  let argStr = args.join(" ");
 | 
					  let argStr = args.join(" ");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  switch (subcommand) {
 | 
					  switch (subcommand) {
 | 
				
			||||||
| 
						 | 
					@ -539,7 +540,7 @@ command.callback = async function (
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
          if (argStr.match(/https?:\/\//)) {
 | 
					          if (argStr.match(/^https?:\/\//)) {
 | 
				
			||||||
            const contentType = await fetch(argStr).then((res) =>
 | 
					            const contentType = await fetch(argStr).then((res) =>
 | 
				
			||||||
              res.headers.get("Content-Type")
 | 
					              res.headers.get("Content-Type")
 | 
				
			||||||
            );
 | 
					            );
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue