Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main feature: database #55

Open
bast0006 opened this issue Aug 18, 2021 · 2 comments · May be fixed by #107
Open

Main feature: database #55

bast0006 opened this issue Aug 18, 2021 · 2 comments · May be fixed by #107
Assignees
Labels
a: database Related to or causes database changes p: high High Priority s: approved The issue has received a maintainer's approval t: feature Relating to the functionality of the application.

Comments

@bast0006
Copy link
Collaborator

bast0006 commented Aug 18, 2021

We need a database module to store things persistently, such as thread state.

Things that need storing:

  • Thread metadata (originating message, thread ID, user )
  • Thread message data (who wrote, was internal, highest role, message content, reactions? Attachments? )
  • Config data (should just be a string/string KVS for now because that's how db config works)

These things should be server-keyed so in the future we can support multiserver if we want.

@bast0006 bast0006 added a: bot a: database Related to or causes database changes p: high High Priority s: approved The issue has received a maintainer's approval s: planning Discussing details t: feature Relating to the functionality of the application. labels Aug 18, 2021
@bast0006 bast0006 self-assigned this Aug 18, 2021
@bast0006 bast0006 added this to To do in v1.0.0 via automation Aug 18, 2021
@bast0006
Copy link
Collaborator Author

bast0006 commented Aug 18, 2021

From ARU:

stuff needed in the database for threads:
Ticket
id, created at, who created it (eg a member, or themselves), 

Messages:
author
server_message_id
dm_message_id
attachments
embeds
contents
was_internal?

All of thread messages, and attachments links and stuff too, including a ticket and author (user) object


user table: all users who've interacted with modmail
id
default avatar number
name
dm_channel_id

@bast0006
Copy link
Collaborator Author

bast0006 commented Aug 18, 2021

So, schema:
Ticket:

  • id (INTERNAL)
  • server_id
  • thread_id
  • creator_id (user ID)
  • user_id (target user ID)
  • creating_message_id
  • creating_channel_id

Messages:

  • id (from discord, dm id)
  • ticket_id
  • mirrored_id (in server message id)
  • author_id
  • content
  • internal

Attachments:

  • internal id
  • message id
  • link

Embeds:

  • internal id
  • message id
  • json content as a bytes field

Emoji: (Later feature)

  • id
  • url
  • animated

emoji_messages:

  • emoji_id
  • message_id

Configuration:

  • server_id
  • optional thread_id for thread specific config
  • config key name
  • config value

@Shivansh-007 Shivansh-007 mentioned this issue Aug 28, 2021
4 tasks
@Shivansh-007 Shivansh-007 removed s: planning Discussing details a: bot labels Sep 2, 2021
@Shivansh-007 Shivansh-007 linked a pull request Nov 1, 2021 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: database Related to or causes database changes p: high High Priority s: approved The issue has received a maintainer's approval t: feature Relating to the functionality of the application.
Projects
v1.0.0
To do
bot
Awaiting triage
Development

Successfully merging a pull request may close this issue.

2 participants