#401 Error when running command

1 messages · Page 1 of 1 (latest)

zenith horizon
#

Making this a thread to save space

#

Can you please show a screenshot of where the error occurs

crude tapir
#

ya

raw sun
#

ok

crude tapir
#

ig

#

the bots remove commands interaction is not working coz of that

warped wren
#

can you please show the full error

crude tapir
warped wren
#

and relevant code

fickle krakenBOT
zenith horizon
#

It's possible that the 401 error you're experiencing is not to do with discord.js but whatever other API you seem to be interfacing with

crude tapir
#
TypeError: channel.isTextBased is not a function
    at InteractionCreateAction.handle (/home/container/node_modules/discord.js/src/client/actions/InteractionCreate.js:50:33)
    at Object.module.exports [as INTERACTION_CREATE] (/home/container/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js:4:36)
    at WebSocketManager.handlePacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:352:31)
    at WebSocketShard.onPacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:489:22)
    at WebSocketShard.onMessage (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:328:10)
    at callListener (/home/container/node_modules/ws/lib/event-target.js:290:14)
    at WebSocket.onMessage (/home/container/node_modules/ws/lib/event-target.js:209:9)
    at WebSocket.emit (node:events:513:28)
    at Receiver.receiverOnMessage (/home/container/node_modules/ws/lib/websocket.js:1180:20)```
fickle krakenBOT
zenith horizon
#

Oh, yeah, that's a known issue

warped wren
#

401 is different than that error

zenith horizon
crude tapir
warped wren
#

can you please show the part of the 401 error

crude tapir
raw sun
#

reset the token and replace the old one ig

warped wren
#

no thats not the issue

zenith horizon
#

It's not a discord.js issue

#

by the looks of things

crude tapir
#

it doesnt work in that way

warped wren
#

we dont know that without a proper error stack

#

can you please show a full error stack

crude tapir
zenith horizon
#

@crude tapir What does that command do? Please provide some code.

crude tapir
warped wren
#

the main question here is what are you doing for the error to occur

zenith horizon
#

Whichever one you run to cause the issue

raw sun
#

show the full error pls

crude tapir
warped wren
#

i cant give a solution without the full error stack

#

thats not the stack

zenith horizon
#

It looks like you're catching an error somewhere and just writing the message to the console

#

so it's more important to know what you do that causes the error first

proper wharfBOT
#

mdn Error.prototype.stack
The non-standard stack property of an Error instance offers a trace of which functions were called, in what order, from which line and file, and with what arguments. The stack string proceeds from the most recent calls to earlier ones, leading back to the original global scope call.

warped wren
#

again, if you could explain what you're doing for the error to happen would really be helpful

crude tapir
#

w8

#

free bot and premium bot

zenith horizon
#

That's not relevant

warped wren
#

...

crude tapir
#

the free bot was having this error a week ago

zenith horizon
#

Or shouldn't be

crude tapir
#

and the premium bot is having this error from today

warped wren
#

that is not relevant

zenith horizon
#

So there's a common bug in both of them

#

that's expected

#

what command

#

causes the issue

crude tapir
#

when starting the bot

warped wren
#

it would've been nice if you said that from the beginning

zenith horizon
#

What does the bot do when starting up? Does it make any calls to other APIs?

warped wren
#

can you please show an error stack

#

all of this back and forth is going nowhere

crude tapir
#

can express be the source for this err

warped wren
#

we dont know without an error stack

zenith horizon
#

We can't get an error stack without knowing where the error originates

#

so calm it down, Joe

warped wren
#

im perfectly fine

#

errors should be showing a full error stack, not just one line

#

so that has to do with the error handling

#

there's only so much we can do with the information that is given to us

zenith horizon
#

@crude tapir Check express, and any other elements in your bot's start routines for catch statements. Replace console.log with console.trace

zenith horizon
#

At least that'll give us some info about what's being called where

zenith horizon
#

?

crude tapir
#

w8 - wait

#

will this be the cause

crude tapir
#

still there is err

zenith horizon
warped wren
#

error is happening because your code thinks the token it's wrong

crude tapir
#

w8 i remember smt

#

ah at the same time when i add new commands in commands folder its not registering

#

so am using a separate file to register cmds

warped wren
#

this has to do with your token not matching with your client id

crude tapir
#

i will check it w8

crude tapir
#

@zenith horizon @raw sun @warped wren Thankyou guys

#

i fixed it

raw sun
#

what was it?

crude tapir
#

u were right

#

it was token client id err

raw sun
#

oh

#

ok