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
my bot crashes when i use the kick command
Full error:
C:\Users\wlodz\Projects\revoltBots\construct\construct\node_modules\solid-js\store\dist\server.cjs:67
next = current[part];
^
TypeError: Cannot read properties of undefined (reading 'lastMessageId')
at updatePath (C:\Users\wlodz\Projects\revoltBots\construct\construct\node_modules\solid-js\store\dist\server.cjs:67:19)
at updatePath (C:\Users\wlodz\Projects\revoltBots\construct\construct\node_modules\solid-js\store\dist\server.cjs:64:7)
at ChannelCollection.setStore [as updateUnderlyingObject] (C:\Users\wlodz\Projects\revoltBots\construct\construct\node_modules\solid-js\store\dist\server.cjs:83:66)
at C:\Users\wlodz\Projects\revoltBots\construct\construct\node_modules\revolt.js\lib\cjs\events\v1.js:77:41
at batch (C:\Users\wlodz\Projects\revoltBots\construct\construct\node_modules\solid-js\dist\server.cjs:105:10)
at C:\Users\wlodz\Projects\revoltBots\construct\construct\node_modules\revolt.js\lib\cjs\events\v1.js:75:42
at Generator.next (<anonymous>)
at fulfilled (C:\Users\wlodz\Projects\revoltBots\construct\construct\node_modules\revolt.js\lib\cjs\events\v1.js:5:58)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
kick command code:
import{replyWithErr}from"../lib.js";constlog=console.logexportdefault{name: 'kick',aliases: [],// privilege: CommandPrivilege.Manager,asyncrun(message,args,command,db,bot,{ client }){constisOwner=message.author.id==bot.owner.idif(!(isOwner||message.member.hasPermission(message.server,"KickMembers"))){replyWithErr(message,"Missing permission");return}if(message.server.ownerId==message.mentionIds[0]){replyWithErr(message,"Unable to kick owner");return}if(message.mentionIds==undefined){replyWithErr(message,"Missing argument 1");return}if(message.mentionIds[0]==bot.id){replyWithErr(message,"I can't kick myself!");return}varmyRank=awaitmessage.server.fetchMember(bot.id).rankingvartargetRank=awaitmessage.server.fetchMember(message.mentionIds[0]).rankingif(myRank>targetRank){replyWithErr(message,"My rank is lower than the rank of the person you are trying to kick");return}try{message.server.kickUser(message.mentionIds[0])}catch(err){log(`! Fatal Error: ${err}`)console.log(err)message.reply("someting went wrong, check if the bot has permission to kick/ban and try again!")return}try{if(message.server.id=="01H36T7ZNX7ZMQ4FKB2TZHKX04"){Array.prototype.random=function(){returnthis[Math.floor(Math.random()*this.length)]}letkillers=[':01HJ1E0VN82X9HY5NZTDK93NJF:',':01HKF2GPK971GA0XP5DQQ3F78B:',':01HKJBBYTGFT42EKC6HYHDZVDT:',':01HKJBD22G8WA376S10VPZJP5X:',':01HKJBV6E07JG64HP7HSV450GA:',':01HKJC0KPYX980T3ARTBH4W97K:',':01HKJC124ZVN8JXRZ478X65ZCG:',':01HKJBWN7A59Q0K3AKCE37BJJN:',':01HKJBX09P4Z8NTBEZDHN09K61:',];letweepons=[':01H36VVBSK3C72AFNGSFT6HQQ1:',':01H36VVSHZJS8JPZ55ZNCA0N08:',':01H36VWDPEQ3EYNEDRR933311E:',':01H36VWZ54FN14YV4ABYARAT22:',':01H36VXB1CJTM070PBZXAGGNY4:',':01H36VXVGQQZ9YQX5X991NA9PH:',':01H36VYF63ZNMN3Y0NKSQN3W5Z:',];try{if(client.channels.get("01H8A1BFF1F2Q2AT6629WC6A4Q")){client.channels.get("01H8A1BFF1F2Q2AT6629WC6A4Q").sendMessage(`${killers.random()}${weepons.random()}${message.args[0]}`)}}catch(fatalError){log(`! Fatal Error: ${fatalError}`)console.log(JSON.stringify(fatalError))}}else{try{message.channel.sendMessage(`<@${message.mentionIds[0]}> kicked`)}catch(fatalError){log(`! Fatal Error: ${fatalError}`)console.log(JSON.stringify(fatalError))}}}catch(fatalError){log(`! Fatal Error: ${fatalError}`)console.log(JSON.stringify(fatalError))}},}
it gets to the client.channels.get("01H8A1BFF1F2Q2AT6629WC6A4Q").sendMessage(`${killers.random()}${weepons.random()}${message.args[0]}`) part before crashing
pls help
The text was updated successfully, but these errors were encountered:
My suggestion to this issue, for the time being, is commenting out this piece of code until ServerDelete can tell the client that the event is a leave or a delete on the client's end.
amycatgirl
added a commit
to amycatgirl/revolt.js
that referenced
this issue
Sep 23, 2024
Does "client receives" imply the bot is receiving the ServerDelete for the member?
I was noticing some strange behaviour with member leaves, this might be a backend bug.
What happened?
my bot crashes when i use the kick command
Full error:
kick command code:
it gets to the
client.channels.get("01H8A1BFF1F2Q2AT6629WC6A4Q").sendMessage(`${killers.random()}${weepons.random()}${message.args[0]}`)
part before crashingpls help
The text was updated successfully, but these errors were encountered: