discord-modmail / modmail

A Modmail bot for Discord. Allowing safe moderator conversations with server members one server at a time.
https://discord-modmail.readthedocs.io/
MIT License
15 stars 8 forks source link

Main feature: database #55

Open bast0006 opened 3 years ago

bast0006 commented 3 years ago

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

Things that need storing:

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

bast0006 commented 3 years ago

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 commented 3 years ago

So, schema: Ticket:

Messages:

Attachments:

Embeds:

Emoji: (Later feature)

emoji_messages:

Configuration: