Skip to content

Conversation

@zeltim1
Copy link

@zeltim1 zeltim1 commented May 20, 2022

:jit:

@ecsr ecsr linked an issue May 21, 2022 that may be closed by this pull request
Copy link
Member

@ecsr ecsr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be implemented using discord.js modals instead of using a thirdparty package? Discord.js documentation on modals can be found here.

@zeltim1
Copy link
Author

zeltim1 commented May 22, 2022

Works with discord.js modals now.
Moved interactionCreate from index.js to the EventHandler.
Also created a functions folder

@ghost
Copy link

ghost commented May 23, 2022

Don't get the reactions lost when a longer giveaway is occuring and the bot restarts.
I would suggest implementing our database.

@zeltim1
Copy link
Author

zeltim1 commented May 25, 2022

How would a database help this tho? The reactions are still there, it's just that the "countdown" has to be reactivated after a restart somehow.

@ghost
Copy link

ghost commented May 25, 2022

How would a database help this tho? The reactions are still there, it's just that the "countdown" has to be reactivated after a restart somehow.

The reactions are there on the discord but not stored so ultimately after a restart the whole giveaway needs to be posted again.

Thats why I would suggest saving the id of the message createdAt updatedAt and so on.
A message can also have multiple reactions where I would store:
userId

Now the bot can check through those message ids if one ends pick a winner from saved userId's

Copy link
Member

@ecsr ecsr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure you run the linter and formatter as well, you can do this by running the following commands in a terminal.

$ npx eslint src/
$ npx prettier --write src/

@ecsr
Copy link
Member

ecsr commented May 28, 2022

Also as @ckhenzy is saying we probably want to store some information in the database, message id, giveaway deadline and emoji should be enough and then we can retrive all users who reacted when needed.

@ghost
Copy link

ghost commented May 28, 2022

I would store the gamekey aswell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Giveaway command

2 participants