#no lmao

1 messages ยท Page 1 of 1 (latest)

ocean bane
#

explain here

fair seal
#

Kiter i just want to tell you they already got all informations they need twice ๐Ÿ˜‚

ocean bane
#

Yea i kno

#

mexi is a friend of mine

#

they told me lol

fair seal
#

oh okay just wanted to say before this thread ends in 1 year ๐Ÿ™ sorry dont wanted to interrupt

ocean bane
#

is fine i got time

#

starting off isnt always easy

pastel dome
# ocean bane explain here
    if(!ButtonInteraction.isButton()) return
    if (ButtonInteraction.customId === 'test')
    {
        const wait = require('util').promisify(setTimeout)
        await wait(1000) // Every 1000 ms = 1 second
        await ButtonInteraction.reply({ content: 'e <ping userhere>'  })
    }```
and im too dumb to make it ping user here i was trying to make it work for like 2 hours and i didnt manage to do that...
ocean bane
#

theres many more issues here

#

you are requiring something in your handler

#

take that out of your code block and put it at the top of the file

#

const wait

pastel dome
#

everything is ok rn wen i press button it actually says "e <ping userhere>" as in content:

ocean bane
#

no its not

#

follow my instructions please, your code doesnt follow basic js

pastel dome
#
    if(!ButtonInteraction.isButton()) return
    if (ButtonInteraction.customId === 'test')
    {
        await wait(1000) // Every 1000 ms = 1 second
        await ButtonInteraction.reply({ content: 'e <ping userhere>'  })
    }
#

ok put that to the top

ocean bane
#

you want to make it mention them

pastel dome
#

in place of <ping userhere> i want it to actually mention them

#

like with simple ping like that: @pastel dome

ocean bane
#

what you can do is take their id and enclose it by <@ >

#

or you use interaction.user.toString() like mexi said

pastel dome
ocean bane
#

Also for your information, if you type ping user discord js in google you get

#

this whole page of search results

#

you can research

#

and try your code, to see what solution solves your problem

ocean bane
#

see what it is made up of, and what properties you could use to get the information you want

#

Have you ever worked with js before?

pastel dome
ocean bane
#

so thats a no, since i asked if you have JS experience xd

#

try the steps i sent and learn from those

fair seal
#

and now one time more xD

cunning maple
#

i even elaborated it further

ocean bane
pastel dome
ocean bane
#

where

#

in your console?

pastel dome
#

in discord

ocean bane
#

interaction.reply

#

it is required to always reply to an interaction

#

but why start with buttons

#

why not first learn about djs, building from what you do know

#

you dont throw a baby in the pool and expect it to swim ๐Ÿ˜‰

#

i hope

pastel dome
pastel dome
#

to test their reflexes

ocean bane
#

what does your code look like now