utility.banner: server support
This commit is contained in:
		
							parent
							
								
									4c718e3a9a
								
							
						
					
					
						commit
						3e2a3cd567
					
				
					 1 changed files with 22 additions and 1 deletions
				
			
		| 
						 | 
					@ -137,7 +137,28 @@ banner.usage = "<user>";
 | 
				
			||||||
banner.callback = async function (msg, line) {
 | 
					banner.callback = async function (msg, line) {
 | 
				
			||||||
  let id = msg.author.id;
 | 
					  let id = msg.author.id;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (line) {
 | 
					  if (line == "--server" || line == "--guild") {
 | 
				
			||||||
 | 
					    if (!msg.channel.guild) {
 | 
				
			||||||
 | 
					      return "`--server/--guild` can only be used within guilds.";
 | 
				
			||||||
 | 
					    } else {
 | 
				
			||||||
 | 
					      const url = `${BANNER_BASE}${msg.channel.guild.id}/${
 | 
				
			||||||
 | 
					        msg.channel.guild.banner
 | 
				
			||||||
 | 
					      }.${
 | 
				
			||||||
 | 
					        msg.channel.guild.banner.startsWith("a_")
 | 
				
			||||||
 | 
					          ? "gif?size=1024&_=.gif"
 | 
				
			||||||
 | 
					          : "png?size=1024"
 | 
				
			||||||
 | 
					      }`;
 | 
				
			||||||
 | 
					      return {
 | 
				
			||||||
 | 
					        embed: {
 | 
				
			||||||
 | 
					          title: "Server Banner",
 | 
				
			||||||
 | 
					          url,
 | 
				
			||||||
 | 
					          image: {
 | 
				
			||||||
 | 
					            url,
 | 
				
			||||||
 | 
					          },
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					      };
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  } else if (line) {
 | 
				
			||||||
    const lookup = await lookupUser(msg, line);
 | 
					    const lookup = await lookupUser(msg, line);
 | 
				
			||||||
    if (
 | 
					    if (
 | 
				
			||||||
      lookup == "No results" ||
 | 
					      lookup == "No results" ||
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue