You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm using this module for my bot made in discord.js, and sometimes I get random errors like
Error: Invalid component ID 33 in SOS
Error: Invalid component ID 12 in SOS
Error: Bogus marker length
Error: Huffman table 0x03 was not defined
My code is:
constDiscord=require('discord.js')constCanvas=require('canvas')constfs=require('fs')constdb=require('megadb')constbsonDB=require("bsondb");const{ createCanvas, loadImage }=require('canvas');constrequest=require('node-superfetch');constglitch=require('glitch-canvas')module.exports={name: 'glitch',description: '',asyncexecute(client,message,args){letuser=message.mentions.members.first()||message.guild.members.cache.get(args[0])||message.memberletimage=user.user.displayAvatarURL({format: 'jpeg',size: 1024})//url belowconst{ body }=awaitrequest.get(image);constdata=awaitloadImage(body);constcanvas=createCanvas(data.width<250 ? 278 : data.width,data.height<250 ? 278 : data.height);//using this because I think it happens with small imagesconstctx=canvas.getContext('2d');ctx.drawImage(data,0,0,canvas.width,canvas.height);constattachment=canvas.toBuffer();glitch({seed: Math.floor(Math.random()*20),itinerations: Math.floor(Math.random()*20),amount: Math.floor(Math.random()*20)}).fromBuffer(attachment).toBuffer().then(function(glitchedBuffer){message.channel.send({files: [{attachment: glitchedBuffer,name: 'glitch.jpeg'}]})}).catch(error=>{message.channel.send('Please, use the command another time. '+error)})}}
Hi, I'm using this module for my bot made in discord.js, and sometimes I get random errors like
My code is:
Currently I'm using this image
Thanks in advance
The text was updated successfully, but these errors were encountered: