utility.banner: guild error handling
This commit is contained in:
		
							parent
							
								
									c3e94cd593
								
							
						
					
					
						commit
						a066ab27c1
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		| 
						 | 
					@ -175,6 +175,9 @@ banner.callback = async function (msg, line) {
 | 
				
			||||||
      return "`--server/--guild` can only be used within guilds.";
 | 
					      return "`--server/--guild` can only be used within guilds.";
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
      const guild = msg.channel.guild || hf.bot.guilds.get(msg.guildID);
 | 
					      const guild = msg.channel.guild || hf.bot.guilds.get(msg.guildID);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      if (!guild.banner) return "This guild does not have a banner.";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      const url = `${BANNER_BASE}${guild.id}/${guild.banner}.${
 | 
					      const url = `${BANNER_BASE}${guild.id}/${guild.banner}.${
 | 
				
			||||||
        guild.banner.startsWith("a_") ? "gif?size=1024&_=.gif" : "png?size=1024"
 | 
					        guild.banner.startsWith("a_") ? "gif?size=1024&_=.gif" : "png?size=1024"
 | 
				
			||||||
      }`;
 | 
					      }`;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue