#ChatInputCommandInteraction

1 messages · Page 1 of 1 (latest)

coarse lagoon
#

How to correctly define ChatInputCommandInteraction, I tried importing it from the framework, however is returned this: TypeError: Right-hand side of 'instanceof' is not an object

I'm trying to do this:
I have a createError function, which sends a embed with the provided text and then deletes the message and the embed after some seconds, however I want it only reply if the variable is a interaction instance.

Here's the createError code: https://pastebin.com/nNHV5Xr4
isInteractionInstance function: https://pastebin.com/fKsTMAUi

next fogBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

olive forum
#

ChatInputCommandInteraction is a type, not a class. CommandInteraction is a class, though.

#

You might want to use Interaction though, to handle buttons & etc

coarse lagoon
#

good idea, do I import Interaction from the framework?

olive forum
#

It's from discord.js

coarse lagoon
#

TypeError: Right-hand side of 'instanceof' is not an object

  const { Interaction } = require("discord.js");
  return variable instanceof Interaction;```
olive forum
coarse lagoon
#

it worked, however when a message object is provided it sends the embeds replying to the command, when it should send the embed (not replying), then delete the command and the embeds 3 seconds after

olive forum
#

how would it send the embeds replying to the command if there was no command

coarse lagoon
#

wdym

olive forum
#

wdym

coarse lagoon
#

wdym there was not a command

olive forum
#

I mean command interaction

coarse lagoon
#

i was talking about message commands

olive forum
#

Show your updated code

coarse lagoon
olive forum
#

And the function?