PretendoNetwork / Bandwidth

Official Pretendo Network Discord community bot
GNU Affero General Public License v3.0
3 stars 12 forks source link

Polling and rules verification #5

Closed hauntii closed 1 year ago

hauntii commented 1 year ago

This PR adds the following to Bandwidth:

Heads up: these have a lot of pictures.

About polling Polls can be created with the command `/poll`. This will popup a modal with up to five total options! As soon as the modal is submitted a poll will be sent in the channel the command was sent in. ![Screenshot 2023-04-23 161938](https://user-images.githubusercontent.com/57009359/233863964-31d70938-12de-4e55-a5e0-93473b7c7fce.png) ![Screenshot 2023-04-23 162134](https://user-images.githubusercontent.com/57009359/233863973-60fc346b-d3f5-4545-b5bf-17681a8bd162.png) ![Screenshot 2023-04-23 161913](https://user-images.githubusercontent.com/57009359/233863982-9637e0ea-ff94-4ce0-87c9-73636a49057e.png) Polls can be set to have an expiry time from the command. This time is formatted as a unix timestamp. ![image](https://user-images.githubusercontent.com/57009359/233864067-7924acbf-7a8d-49fa-96d1-c8784b339f72.png) Polls will end at their expiry time (if they have one), or can be closed immediately from the message's context menu. ![image](https://user-images.githubusercontent.com/57009359/233864170-c2f2091b-48da-4586-a6f4-704fd1e9056b.png) When polls expire, users are no longer able to vote and the winner is highlighted with a shiny green! ![image](https://user-images.githubusercontent.com/57009359/233864266-6bd3c1cc-f26b-4484-b0d6-9972b8d62413.png) Polls update every minute in order to stop ratelimiting from too many updates.
About rule management Rules can be managed with `/rule` and its subcommands, `create, update, preview, remove`. Creating a rule is as simple as running `/rule create` and filling out the details! You can set a time users will have to wait during verification here. I recommend to increase it for more important rules. ( I use 5 as a standard ) ![image](https://user-images.githubusercontent.com/57009359/233864427-412ae739-8065-4054-9fd4-8992ea2f2c03.png) You will then see a preview, and can choose to create the rule. It will be added to the end of the rule list. ![image](https://user-images.githubusercontent.com/57009359/233864526-3f51ed99-e39e-49c6-806b-e28e8cebc5fb.png) If for some reason you have to update a rule, you can do that too! Using `/rule update` is just as easy as creating a rule. Just select the rule you want to edit, and you'll see the same process for creating a rule. ![image](https://user-images.githubusercontent.com/57009359/233864678-10fa8163-18cf-460b-bdf1-0c4d75fa51e7.png) If you don't like a rule you've made, you can simply remove it with `/rule remove` and selecting the rule you don't want. If you want to see what a user sees during verification, just run `/rule preview` and select it. ![image](https://user-images.githubusercontent.com/57009359/233864796-1dcea4b2-5327-438c-8677-2e2ad5267048.png)
About rule verification Once setup, users will be given an "unverified" role on join. (Setting `unverified_role_id`) If permissions are setup properly, users will have to use the `view-rules` button to have the role removed and full server access given. When the button is pressed, Bandwidth will reply with a rules onboarding where users will wait the time specified during rule creation to continue. If it is 0, they may instantly continue. ![image](https://user-images.githubusercontent.com/57009359/233865086-c564291a-6e45-45b4-b7b4-25e9c0c167f2.png) ![image](https://user-images.githubusercontent.com/57009359/233865319-d9dcf3c9-4363-42b9-a2af-b57de5cbb580.png) When they have reached the last rule, they will be presented with a `Verify` button that removes the role when the timer expires. `@everyone` should *not* have access to the verification channel. ![image](https://user-images.githubusercontent.com/57009359/233865364-0b191dc9-7782-4f9f-afa3-8fa127bbd42c.png)
jonbarrow commented 1 year ago

Doesn't Discord already have this kind fo rules onboarding built in?

hauntii commented 1 year ago

The built-in onboarding is "click a checkbox and you're in", which isn't very effective. I know I've clicked straight past it multiple times (because usually I read the rules already) but most users dont read the rules, so this is just a more strict gate.

jonbarrow commented 1 year ago

Can't users still just click past all this too?

hauntii commented 1 year ago

In theory yes, but as there's an adjustable timer it's a bit more encouraging to actually read it.