appinfo+userinfo: dont say deleted for system accounts
This commit is contained in:
		
							parent
							
								
									fddf7621a4
								
							
						
					
					
						commit
						2947f688a1
					
				
					 2 changed files with 6 additions and 2 deletions
				
			
		| 
						 | 
					@ -282,6 +282,8 @@ appinfo.callback = async function (msg, line) {
 | 
				
			||||||
      try {
 | 
					      try {
 | 
				
			||||||
        const bot = await hf.bot.requestHandler.request("GET", APIEndpoints.USER(snowflake), true);
 | 
					        const bot = await hf.bot.requestHandler.request("GET", APIEndpoints.USER(snowflake), true);
 | 
				
			||||||
        if (bot) {
 | 
					        if (bot) {
 | 
				
			||||||
 | 
					          const isSystem = bot.system || bot.discriminator === "0000";
 | 
				
			||||||
 | 
					          if (isSystem) return `System users do not have applications.`;
 | 
				
			||||||
          return `Application has been deleted.\nBot user: ${formatUsername(bot)}`;
 | 
					          return `Application has been deleted.\nBot user: ${formatUsername(bot)}`;
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
          return "ID provided does not point to a valid application.";
 | 
					          return "ID provided does not point to a valid application.";
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -423,10 +423,12 @@ userinfo.callback = async function (msg, line) {
 | 
				
			||||||
    descLines.push("");
 | 
					    descLines.push("");
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (botDeleted) {
 | 
					  const isSystem = user.system || user.discriminator === "0000";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if (botDeleted && !isSystem) {
 | 
				
			||||||
    descLines.push("*This bot's application has been deleted*\n-# (or app ID and user ID desync)");
 | 
					    descLines.push("*This bot's application has been deleted*\n-# (or app ID and user ID desync)");
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  if (user.system) {
 | 
					  if (isSystem) {
 | 
				
			||||||
    descLines.push("**System account**");
 | 
					    descLines.push("**System account**");
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  descLines.push("");
 | 
					  descLines.push("");
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue