smilegodly / mewbot

A discord bot with some cool features made with Python.
2 stars 3 forks source link

Movie Night Voting System #44

Closed smilegodly closed 3 years ago

smilegodly commented 3 years ago

Create a movie voting system incorporated within mewbot. Each person would have 1 vote per movie board instance

A rough outline example of how it might look is

!add "John Wick 2" adds movies to the movie voting board !vote "John Wick 2" to vote for the movie in the list !movielist to display all of the movies being voted on preferably in a numbered list

matt-ross16 commented 3 years ago

Hey, interested in working on this. What are your thoughts? Are you looking for more of a time-limited poll, or a on going, ever-growing list?

JungleM0nkey commented 3 years ago

Hey, if you end up working on this, I wrote an api for votenight and we can link those 2 together!

smilegodly commented 3 years ago

@matt-ross16 A time limited poll that resets every Monday so that the voting can be done during the week of. This feature is being made to be used every Friday Night (movie night)! I want users to be able to throw movie suggestions at it, query the list of movies (with the votes shown) and then have users be able to vote on 1 movie in the list. Each user can get 1 movie added and 1 vote per week to prevent spam. In terms of formatting, the list could be embedded in a code block in markdown before being sent to the user. I'm open to suggestions on this though.

@JungleM0nkey I'm glad to hear we can use your API. Thanks!

matt-ross16 commented 3 years ago

@smilegodly So each week, the users add movies to a list, vote on it, then the contents of the list gets deleted on Monday to start fresh?

@JungleM0nkey do you have a link to your API to check out?

JungleM0nkey commented 3 years ago

@matt-ross16

The API is for a small project of mine I wrote earlier this year: https://github.com/JungleM0nkey/votenight You can essentially vote on what movie to watch and add other films to a backlog to watch later. The API right now allows only to GET data from the portal, but I can easily add POST requests to allow voting from a discord bot.

The API routes can be found in this file: https://github.com/JungleM0nkey/votenight/blob/master/app/routes.py

smilegodly commented 3 years ago

@smilegodly So each week, the users add movies to a list, vote on it, then the contents of the list gets deleted on Monday to start fresh?

That's the basic idea , yes!

The API right now allows only to GET data from the portal, but I can easily add POST requests to allow voting from a discord bot.

This seems like a good match up! We could leverage the code that @JungleM0nkey wrote to handle the backend portion.

JungleM0nkey commented 3 years ago

Let me know if you guys end up needing the extra API capability and I will add it to the votenight repo / give you the necessary access to votenight.ca

matt-ross16 commented 3 years ago

I think this partnership would be the ideal situation. If you don't mind adding the extra functionality to the API, I think we could put it to good use!

JungleM0nkey commented 3 years ago

Sounds good, I should be done with the voting functions by the end of today. Will let you guys know once I do the push

JungleM0nkey commented 3 years ago

@matt-ross16 Just finished updating the repo aswell as the live version on votenight.ca! All the functionality should be there now

matt-ross16 commented 3 years ago

Thanks! I haven't found the time yet to get to this today, but will dive in tomorrow! :)

smilegodly commented 3 years ago

@matt-ross16 You will need to make an account on votenight.ca/register for the bot to make requests from. The API requires authentication to happen. @JungleM0nkey will give you the invite code.

matt-ross16 commented 3 years ago

Apologies for the silence. Life gets in the way sometimes, but I'm back on board now! Working on building the commands needed right now, and will be implementing the API over the next couple of days.

I only hope it goes that smoothly haha

matt-ross16 commented 3 years ago

Hey @JungleM0nkey,

I'm trying to run the API locally so that I can figure out the routes I'll need and debug them, but it's getting caught up not having a SECRET_KEY set. Do I need to add this to my env variable?

image

JungleM0nkey commented 3 years ago

Hey @JungleM0nkey,

I'm trying to run the API locally so that I can figure out the routes I'll need and debug them, but it's getting caught up not having a SECRET_KEY set. Do I need to add this to my env variable?

image

Correct. However there is an easier way if you dont want to deal with the environment variable you can change the line to

SECRET_KEY = os.environ.get('SECRET_KEY') or 'your-random-string-here'
smilegodly commented 3 years ago

How's this coming along ? @matt-ross16

matt-ross16 commented 3 years ago

Sorry about the delay on things. School took over and has put a delay on this work. When next week comes around, I'm going to dive back into this and really dig in.

Apologies for not keeping both in the loop on that