userinfo: untry rq
This commit is contained in:
		
							parent
							
								
									c515f1d401
								
							
						
					
					
						commit
						a3f4f6aa96
					
				
					 1 changed files with 21 additions and 21 deletions
				
			
		| 
						 | 
					@ -511,29 +511,29 @@ userinfo.callback = async function (msg, line) {
 | 
				
			||||||
    const baseUrl = `https://cdn.discordapp.com/assets/collectibles/${nameplate.asset}`;
 | 
					    const baseUrl = `https://cdn.discordapp.com/assets/collectibles/${nameplate.asset}`;
 | 
				
			||||||
    let imageUrl = baseUrl + "/static.png";
 | 
					    let imageUrl = baseUrl + "/static.png";
 | 
				
			||||||
    if (palette) {
 | 
					    if (palette) {
 | 
				
			||||||
      try {
 | 
					      //try {
 | 
				
			||||||
        const static = await fetch(imageUrl)
 | 
					      const static = await fetch(imageUrl)
 | 
				
			||||||
          .then((res) => res.arrayBuffer())
 | 
					        .then((res) => res.arrayBuffer())
 | 
				
			||||||
          .then((b) => Buffer.from(b));
 | 
					        .then((b) => Buffer.from(b));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        const bg_light = nameplateBackground(palette.lightBackground);
 | 
					      const bg_light = nameplateBackground(palette.lightBackground);
 | 
				
			||||||
        bg_light.composite([{input: static}]);
 | 
					      bg_light.composite([{input: static}]);
 | 
				
			||||||
        const bg_dark = nameplateBackground(palette.darkBackground);
 | 
					      const bg_dark = nameplateBackground(palette.darkBackground);
 | 
				
			||||||
        bg_dark.composite([{input: static}]);
 | 
					      bg_dark.composite([{input: static}]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        const final = sharp({create: {width: 448, height: 168, channels: 4, background: "transparent"}});
 | 
					      const final = sharp({create: {width: 448, height: 168, channels: 4, background: "transparent"}});
 | 
				
			||||||
        final.composite([
 | 
					      final.composite([
 | 
				
			||||||
          {input: await bg_light.toBuffer(), gravity: "north"},
 | 
					        {input: await bg_light.toBuffer(), gravity: "north"},
 | 
				
			||||||
          {input: await bg_dark.toBuffer(), gravity: "south"},
 | 
					        {input: await bg_dark.toBuffer(), gravity: "south"},
 | 
				
			||||||
        ]);
 | 
					      ]);
 | 
				
			||||||
        attachments.push({
 | 
					      attachments.push({
 | 
				
			||||||
          file: await final.png().toBuffer(),
 | 
					        file: await final.png().toBuffer(),
 | 
				
			||||||
          filename: "nameplate.png",
 | 
					        filename: "nameplate.png",
 | 
				
			||||||
        });
 | 
					      });
 | 
				
			||||||
        imageUrl = "attachment://nameplate.png";
 | 
					      imageUrl = "attachment://nameplate.png";
 | 
				
			||||||
      } catch {
 | 
					      //} catch {
 | 
				
			||||||
        // noop
 | 
					      // noop
 | 
				
			||||||
      }
 | 
					      //}
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    nameplateEmbed = {
 | 
					    nameplateEmbed = {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue