feature: add surveylog and survey payload cts and modify bot#15
Open
derrickmehaffy wants to merge 8 commits intomainfrom
Open
feature: add surveylog and survey payload cts and modify bot#15derrickmehaffy wants to merge 8 commits intomainfrom
derrickmehaffy wants to merge 8 commits intomainfrom
Conversation
Adds the two new CTs and has the bot pull from the payload for the survey message and logs surveys sent. It also adds the config sync to keep stuff in sync :)
ComfortablyCoding
suggested changes
May 23, 2022
packages/backend/src/api/new-member-survey/content-types/new-member-survey/schema.json
Outdated
Show resolved
Hide resolved
packages/bot/src/listeners/guild/member/guildMemberAddSendSurvey.js
Outdated
Show resolved
Hide resolved
packages/bot/src/listeners/guild/member/guildMemberAddSendSurvey.js
Outdated
Show resolved
Hide resolved
…ey.js Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>
packages/bot/src/listeners/guild/member/guildMemberAddSendSurvey.js
Outdated
Show resolved
Hide resolved
Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>
…ey.js Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>
Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>
Collaborator
Author
|
FYI I haven't tested this yet, just wrote some of the code this morning when I had some free time |
ComfortablyCoding
suggested changes
May 23, 2022
packages/bot/src/listeners/guild/member/guildMemberAddSendSurvey.js
Outdated
Show resolved
Hide resolved
| const { client, logger } = this.container; | ||
| const { $api } = this.container; | ||
| const currentDate = new Date().toISOString().replace(/T/, ' ').replace(/\..+/, '') | ||
| const payload = await $api.surveyPayload.get() |
Contributor
There was a problem hiding this comment.
This should be moved to inside the try catch, preferably right before the send. No need to do that call if the user is a bot or unable to fetch the member.
| const body = { | ||
| discordUsername: user, | ||
| sentWithoutError, | ||
| sentDatetime: datetime, |
Contributor
There was a problem hiding this comment.
Should we default the datetime to current time and make the param optional? If so, no need for current date in the guildMemberAddSendSurvey event.
This will reduce the need for an additional param to be passed most of the time as usually (if not always?) the current time is what we want.
…ey.js Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the two new CTs and has the bot pull from the payload for the survey message and logs surveys sent. It also adds the config sync to keep stuff in sync :)