For version 3, we are moving away from a system reliant on JSON config files. We will instead be using databases.
[x] Design database to handle per guild information storage, role information storage, question and author information storage, etc.
[x] use an ORM to handle base query typings
[ ] build wrapper types that can construct from the ORM types or relevant discord types. Each should have a get(id or discord object snowflake or ormRow(s)) which does the necessary SQL to put together the whole object, getAll() which gets all of the objects, a set(), and set_() function for each direct sub item
[ ] Guild: contains:
Name,
[x] - get: not needed
[x] - set: set by constuctor
Id,
[x] - get: not needed
[x] - set: set by constuctor
Wiki, (url, for the base wiki of the guild)
[x] - get: not needed
[x] - set: set by constuctor
welcome, (object pulled from the guild record)
[x] get: not needed
[x] set: needs set function
[ ] reset: needs reset function
channels, (object pulled from the guild record, each extending the relevant discord channel)
[x] get: not needed
[x] - set: set by constructor, should be editable via guild.channels.x
roles, (collection pulled from all the roles that are relevant to the specified guild)
[ ] - get: not needed
[ ] - set: needs function for each role in the collection, but roles should be added to the collection by the get() function or the constructor
questions, (collection pulled from all questions that are relevant to the specified guild)
[ ] - get(message id):
[ ] - getAll()
[ ] - set: needs set function
[ ] - add: should take in everything the set function can
emoji, (object pulled from all emoji relevant to the guild)
[x] - get: not needed
[ ] - set(emojiDuty, emoji): needs set function
links, (object pulled from all relevant links to the server)
[x] - get: not needed, should be pulled in by general get function
[ ] - set: needs set function
[ ] - add: needs to have an add function
features, (collection of features that are enabled in the server)
[x] - get: not needed
[ ] - set:
[ ] - add:
[ ] - remove:
Users, (collection of guildUser objects pulled from the guildUserRelationship table),
Faqs (collection of FAQ categories)
[ ] - get:
[ ] - add: adds a new category (each category will need its own add as well)
[ ] - remove:
[ ] - set: needs set function
[x] static get(snowflake) function: queries the DB for a guild with a specific id;
[x] static create(Discord.Guild): Function that will get an existing db guild if it exists, or make a new one.
[ ] static delete(snowflake): Deletes a guild and all data associated with it from the DB
[ ] Question:
Contains everything in the question record, as well as:
Author: (Author object taken from the relevant author's table)
Guild (discord object of the guild relevant to the question)
flags (collection of the flags the question has)
users (collection of discord user IDs, mapped to an array of relationship flags, indicating what kind of relationship(s)) the user has with the question
roleDuties(user or role id): a function that returns an array of the role duties that a user or role has in the guild
[ ] User:
Guilds (the guilds the user is in)
Roles (collection of the roles the user has, taken from the guild roles user relationship table)
questions (collection of questions the user has any relationship to, )
authorProfiles (a collection of author profiles (if any)
For version 3, we are moving away from a system reliant on JSON config files. We will instead be using databases.
[x] Design database to handle per guild information storage, role information storage, question and author information storage, etc.
[x] use an ORM to handle base query typings
[ ] build wrapper types that can construct from the ORM types or relevant discord types. Each should have a get(id or discord object snowflake or ormRow(s)) which does the necessary SQL to put together the whole object, getAll() which gets all of the objects, a set(), and set_() function for each direct sub item
[ ] Guild: contains:
Name,
Id,
Wiki, (url, for the base wiki of the guild)
welcome, (object pulled from the guild record)
channels, (object pulled from the guild record, each extending the relevant discord channel)
roles, (collection pulled from all the roles that are relevant to the specified guild)
questions, (collection pulled from all questions that are relevant to the specified guild)
emoji, (object pulled from all emoji relevant to the guild)
links, (object pulled from all relevant links to the server)
features, (collection of features that are enabled in the server)
Users, (collection of guildUser objects pulled from the guildUserRelationship table),
Faqs (collection of FAQ categories)
[x] static get(snowflake) function: queries the DB for a guild with a specific id;
[x] static create(Discord.Guild): Function that will get an existing db guild if it exists, or make a new one.
[ ] static delete(snowflake): Deletes a guild and all data associated with it from the DB
[ ] Question: Contains everything in the question record, as well as: