Skip to content

feature: add surveylog and survey payload cts and modify bot#15

Open
derrickmehaffy wants to merge 8 commits intomainfrom
script/logs
Open

feature: add surveylog and survey payload cts and modify bot#15
derrickmehaffy wants to merge 8 commits intomainfrom
script/logs

Conversation

@derrickmehaffy
Copy link
Collaborator

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 :)

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 :)
@derrickmehaffy derrickmehaffy self-assigned this May 23, 2022
@derrickmehaffy derrickmehaffy added the enhancement New feature or request label May 23, 2022
…ey.js

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>
derrickmehaffy and others added 5 commits May 23, 2022 10:50
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>
@derrickmehaffy derrickmehaffy marked this pull request as ready for review May 23, 2022 17:54
@derrickmehaffy
Copy link
Collaborator Author

FYI I haven't tested this yet, just wrote some of the code this morning when I had some free time

const { client, logger } = this.container;
const { $api } = this.container;
const currentDate = new Date().toISOString().replace(/T/, ' ').replace(/\..+/, '')
const payload = await $api.surveyPayload.get()
Copy link
Contributor

@ComfortablyCoding ComfortablyCoding May 23, 2022

Choose a reason for hiding this comment

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

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,
Copy link
Contributor

Choose a reason for hiding this comment

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

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants