fsu-fall2022-capstone / Project-Group-5

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

Associate a nation to a location with authentications #17

Closed CoderJoshDK closed 1 year ago

CoderJoshDK commented 1 year ago

Keep track of nations and their passwords

A new DB table is needed to be added. The password needs to be encrypted/decrypted for storage #2.

When a nation is added to a server/dm, it checks to see if it is already in the DB. If it is and a valid password is provided, the entry is updated to the new location. Multiple nations can be associated with a single server // a DM. Part of this config will be the channel to post to.

Table construction

Nation password PIN DM posting_location respond_timer
STR STR STR BOOL BIGINT INT

Calls to table

Call this table whenever a private shard is called. Or for submitting issues. The password should never be stored in memory as best as possible. For submitting an issue, a pin is returned after "prepping" the API. Use that pin. Update the pin after every call. Always provide the pin as frequently as possible. authentication login

CoderJoshDK commented 1 year ago

Change of plan for possible usages. This bot can not be used in DMs. You can interact with it, but nations will only be available through servers. DMs can only be opened with people who are on a server with the bot. At that point, it is better to ensure a connection will work by forcing it to be server only