fsu-fall2022-capstone / Project-Group-5

A discord bot that connects to the online game nationstates
1 stars 0 forks source link

Get and respond to issues #16

Closed CoderJoshDK closed 1 year ago

CoderJoshDK commented 1 year ago

Get Issues and respond

Broken up into two nation types. DM-based and Server-based. DM-based will respond to the issue as soon as an option is picked. Server-based will wait for a configured amount of time before responding. It will make the choice based on a vote

Pre-req

Server

Things to keep in mind

Note about responding

Issues last for 48hrs. For a DM, if an interaction comes after the 48hrs, it should be handled gracefully. For a server, if no votes have been cast on an issue after being timer runs out, the issue is responded to with the option of "skip."

Note about the dropdown view

The dropdown will draw inspiration from the discrod.py example.

Note about the timer for fetching and responding

A DB table should be made to hold the time when the next issue for a nation is released. A task will be running every x minutes. If the time is past due for a new issue, fetch the list of issues from the API.
The same type of logic should be made for the timer. The timer also needs a constant on its range. It can not be longer than 48 hours, as that would mean it is never responded to before it expires. An option can (?) be given for the bot to not vote but only poll.

Responses to explore

What the response is when the issues folder for a nation is full (holds a max of 5 issues). What the response is if you try to respond to an expired issue? I suspect it will just treat it like an invalid request similar to providing a random issue id that does not exist.
When legislation is passed on an issue, it has a chance to unlock things like banners and policies. The exact response structure is unknown.


Quality of life improvements will also be commented on and pointed to in the comments on this issue

CoderJoshDK commented 1 year ago

Quality of life nice to have: #15 Generate the newspapers and submit them as an embed. #

CoderJoshDK commented 1 year ago

Edit to logic

DMs have been removed. A bot can only be interacted with if you have it in a server (discord limitation) meaning you may as well just have it in only servers. If you really only want a nation just for one person, just make a shell server with only a user and a bot.