Skip to content

Add giveaway command/event - #13

Open
zeltim1 wants to merge 22 commits into
sourcejump:mainfrom
zeltim1:main
Open

Add giveaway command/event#13
zeltim1 wants to merge 22 commits into
sourcejump:mainfrom
zeltim1:main

Conversation

@zeltim1

@zeltim1 zeltim1 commented May 20, 2022

Copy link
Copy Markdown

:jit:

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

@ecsr ecsr left a comment

Copy link
Copy Markdown
Member

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

zeltim1 commented May 22, 2022

Copy link
Copy Markdown
Author

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

@ghost

ghost commented May 23, 2022

Copy link
Copy Markdown

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

@zeltim1

zeltim1 commented May 25, 2022

Copy link
Copy Markdown
Author

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

ghost commented May 25, 2022

Copy link
Copy Markdown

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

@ecsr ecsr left a comment

Copy link
Copy Markdown
Member

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/

Comment thread index.js
Comment thread src/functions/modalSubmitGiveaway.js Outdated
Comment thread src/events/interactionCreate.js Outdated
Comment thread src/functions/modalSubmitGiveaway.js Outdated
@ecsr

ecsr commented May 28, 2022

Copy link
Copy Markdown
Member

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

ghost commented May 28, 2022

Copy link
Copy Markdown

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