Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate voting form directly #135

Merged
merged 19 commits into from
Sep 26, 2022
Merged

Generate voting form directly #135

merged 19 commits into from
Sep 26, 2022

Conversation

Cephian
Copy link
Collaborator

@Cephian Cephian commented Sep 21, 2022

Closes #12. Automatically generate and send voting form on !list.

Also added an !image to load an image to be placed at the front of the voting form. A loaded image does not get unset automatically when a form is generated, but it can be cleared manually with !image clear. To set an image use either !image <url> or run !image with an image attachment.

Also added another option full to !list. When either full is passed to !list or the channel the command was issued in is the same as the target channel, the tracklist will be pinned and the form will be generated (and pinned). This is so form generated can be tested before the show.

Check the diffs on README.md for other user-facing changes.

I also added the 👍 and 🛑 emoji to config.py instead of locally to bust.py since they are also used in !image.

image

KNOWN ISSUES

  1. When !image is used, the attachment/url is not scanned at all for validity until the Form is generated. The Form is generated such that if the image is invalid, then generation will still work but without the image.
  2. There is no error/warning when the user-passed BUSTY_GOOGLE_FORM_FOLDER is invalid. The move command just silently fails, though the form is still generated.
  3. If the bot is restarted, the loaded image is lost (unlike the !list cache). Would be nice to save state to disk when set so that we can set the bust image at any point and restart/update busty in the meantime.
  4. While this is MUCH faster than Apps Script, it still takes 5-6 seconds to generate the form. This is done sequentially after list generation, but in theory most steps of Form generation can be done before knowing the track-list (about 2/3 of the total time). We could in theory do those steps simultaneously with track downloading using this async Google API library https://github.com/omarryhan/aiogoogle. Probably not worth it to be honest. A good intern project? ;^)
  5. Not so much an issue, but I'm not sure if we should also keep !form around "just in case" for now.

I'm fine merging with these issues, but 1 & 2 & 3 should have bugs created on merging if this is the case.

Copy link
Owner

@anoadragon453 anoadragon453 left a comment

Choose a reason for hiding this comment

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

Not so much an issue, but I'm not sure if we should also keep !form around "just in case" for now.

Mmm, with the ability to test the form beforehand I'd be surprised if we needed to regenerate after running !list publicly. Even then we could just re-run !list (and delete any audio files that were posted in the meantime).

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
src/config.py Outdated Show resolved Hide resolved
src/main.py Outdated Show resolved Hide resolved
src/bust.py Outdated Show resolved Hide resolved
src/bust.py Outdated Show resolved Hide resolved
src/main.py Show resolved Hide resolved
Copy link
Owner

@anoadragon453 anoadragon453 left a comment

Choose a reason for hiding this comment

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

Sorry for the slow turn-around times. This LGTM!

@Cephian Cephian merged commit e25bc01 into main Sep 26, 2022
@Cephian Cephian deleted the forms_api branch September 26, 2022 21:01
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.

Autogeneration of Google Forms for Voting
2 participants