#unknown run function location

1 messages · Page 1 of 1 (latest)

limber pendant
warped vault
#

aight

limber pendant
#

thats not what i was talking about. show me your interactionCreate event please

#

one sec

warped vault
#

yh i have one in events

#

but i have the code // out

#

and use it in my index rn

#

theres the event one

limber pendant
#

well, you have an execute function

#

not a run function

warped vault
limber pendant
#

do you mind if i ask you if you copy pasted

warped vault
#

nope, was going off an example and changing some stuff to my things

#

i get confused sometimes with run and execute or client and Client coz i just started djs etc

#

ik copy and pasting straight up never works coz everyones codes different

limber pendant
#

okay well a few things to note -

you have no run function as its called execute instead.

your function is also surrounded by an object which that function is also not using.

change the function name to execute and remove the object around it in your cmd

warped vault
#

so just change the run to execute and go from there, alr

limber pendant
#

also remove the object around the parameters

warped vault
#

aight

#

why tf did i put {}

#

2 am coding moment

limber pendant
#

take ur time

warped vault
#

alright i removed the brackets and changed the run to execute

limber pendant
#

alright, lemme know what happens

warped vault
#

bot runs lemme try the cmd now

#

hm application did not respond

limber pendant
#

if the interaction doesnt respond within 3 seconds, you need to defer

warped vault
#

oh right i have .editReply

#

my other codes however use interaction.followUp

#

coz i have defer reply in my slash register

limber pendant
#

right

warped vault
#

like here for eg

limber pendant
#

which cmd is giving the did not...

warped vault
#

play.js , the new one im working on which is the current one im having errors with

limber pendant
#

wait a second

#

why do you have 2 interactionCreate events

#

one event shows this function

#

one event shows this function

#

the execute function has (interaction, client)

#

your cmd probably has (client, interaction)

#

flip them

warped vault
#

yeah it did

limber pendant
#

so in your cmd you need to use (interaction, client)

warped vault
#

yh ik

#

in my other commands i use client, interaction??

limber pendant
#

no

warped vault
#

i do tho

#

and they work

#

fine

#

weird

#

btw same thing app did not respond

limber pendant
#

the function must use the same parameters in the same order

limber pendant
warped vault
#

that code isnbt being used rn

#

im using inter create from my index

#

wait now i know why i couldnt get my interaction create to work in the evnt.. theyre flipped

limber pendant
#

dont listen to ppl who are rude to u btw. some give uncalled for responses and dont realize that it comes off as rude

warped vault
#

yh ik

limber pendant
#

make sure the function is used correctly in all places of your code

warped vault
#

yep its being rn

#

still get application did not respond

#

heres how it currently is

#

btw

#

my toher cmds have like a mod exports.data

limber pendant
#

so you flipped the function parameters in the interaction event right?

warped vault
#

this one doesnt coz the subcommands dont work then

limber pendant
#

wait why are u doing module.exports.run

warped vault
#

yh but ill use it once im done fixing this code

warped vault
#

thats how my code works for some reason

limber pendant
#

you cant flip it once its fixed

#

thats the problem

#

if the event has (client, interaction), then the cmd needs to use (client, interaction)

#

vise-versa

warped vault
#

yeah ik

#

but do i need a mod exports . run?

limber pendant
#

do you call that function anywhere?

warped vault
#

bruh pc crashed

#

And uh yeah should do

limber pendant
#

make sure to fix the function parameters and make sure the cmds are using it properly

#

otherwise, not much else i can do

warped vault
#

yeah ik

#

my point is do i need a module.exports.data like this in my other command

#

or can it just be like this

#

how it is

limber pendant
#

the play cmd layout should look the same as others

warped vault
#

thing is when i did mod exports.data = new i didnt have the subcommands

#

when i did setname play and the desc

#

the command just said /play and everything else wasnt there

limber pendant
#

um

#

well that is based on how your handler is reading the files

warped vault
#

this is my first time using subcommands so not sure

limber pendant
#

i dont work with builders unfortunately

#

also, i do have to go since i have class in a few minutes, but i hope i was able to help you

warped vault
#

alright, yh u did

limber pendant
#

listen to people who are willing to help you, not those who give you a rude attitude

warped vault
#

yeah thats how i do it

limber pendant
#

hope your code gets fixed. gtg bye!