Giveaway interection question
Hello , im new in discordjs, i actually download the foundation of discord bot from github, then on top of it i create my own commands...
I am trying to make a giveaway, but interactionCreate doesn't sync the button, therefore currently i put my button interaction into my giveaway.js... Seek for some help on fixing the following:
1. how can i add button into interactionCreate.js?
2. I trying to create multiple giveaway at the same time, but shows up an error like screenshot, and at the end of the giveaway the bot spam winners.
20 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!I didnt add any database like (MongoDB) for Giveaway
Message Components: Buttons
read more
Common causes of
DiscordAPIError[10062]: Unknown interaction
:
- Initial response took more than 3 seconds ➞ defer the response *.
- Wrong interaction object inside a collector.
- Two processes handling the same command (the first consumes the interaction, so it won't be valid for the other instance)
* Note: you cannot defer modal or autocomplete value responses
If you are waiting for button or select menu input from a specific message, don't create the collector on the channel.
- Channel collectors return component interactions for any component within that channel.
okay, let me try
How can i add this?
its for InteractionCreate.js or giveaway.js?
ok let me see
I got new update on this
ok hold on
Finding your bot token:
- Visit the application dashboard and select your application
- Navigate to the Bot tab (not General Information, not OAuth2)!
- Click
Reset Token
and copy token | https://i.imgur.com/c12eP0t.png (image)
Note: Remember to change the token in your application after you reset itKind of weird i got this error after put in : [ERROR] SyntaxError: Invalid or unexpected token
owh...
found it
any references I can check on?
Message formatting (mentions, timestamps, emoji, etc.): learn more time
Formats a date into a short date-time string.
So if i wanted to have two embed:
1. Embed - giveaway started = allow all member to react the giveaway button 'join, quit & participants'
2. Embed - giveaway ended = show winner
I can use timestamp to count down for it?
Oh which means like the bot send two embed instead of replacing it?
just do that in the end event of the collector
^ can you explain a little more?
Okay.. im not really good at this.. but i try to edit the giveaway once time out
This is how it works now :
InteractionCreate.js
https://sourceb.in/5t6OkOBO0J
giveaway.js
https://sourceb.in/YaL3AmL2iU
Seems like my interaction Failed
which means i have to put my intereaction into below collector , not interactionCreate?
also i have this 2 error :
oh i see... let me try define it direct send out the msg
okay.. I have my ended part put into collection end,
the question is
1. how can i set time out for collection? seems like i put as
dosnt have the exact time as startTime
(example i put '1' inside command , the startTime should be 60 seconds)
and after collection end, the message of giveawayEmbed doesnt edit to giveawayEndEmbed
https://sourceb.in/BlIzkxoSCp
Any idea?
Hi Qjuh, i have fix the issue now, and it works very well , i am very very very appreciate to have your professional help! ❤️