JcbSm / Bridge

Minecraft-Discord bridge
1 stars 5 forks source link

feat: Database Client #1

Closed JcbSm closed 1 year ago

JcbSm commented 1 year ago

Preferably stored as simply as:

Field Datatype Constraints Options...
user_id VARCHAR/BIGINT PK NOT NULL
username VARCHAR
uuid VARCHAR

user_id being the Discord user ID. username will just be the last username they issued the command with, which would be inconsisten if the user changes their MC username. uuid however would be persistent.

Implement the logic here

JcbSm commented 1 year ago

Implement the DatabaseClient at src/main/java/github/jcbsm/bridge/database.

Any files storing information should be stored in the plugin's data foler (Accessed using org.bukkit.plugin.java.JavaPlugin.getDataFolder())

sanamorii commented 1 year ago

For the persistent username issue, the UserUpdateNameEvent event could be implemented to correctly update the name. https://ci.dv8tion.net/job/JDA/javadoc/net/dv8tion/jda/api/events/user/update/UserUpdateNameEvent.html https://jda.wiki/introduction/events-list/#UserUpdateNameEvent

Ziyta commented 1 year ago

Hi I might like to work on this issue, Is 'username' the minecraft username or the discord username also are you wanting to store this in a normal relation db like postgres or mysql? ty

JcbSm commented 1 year ago

Minecraft username.

Any kind of db works really. Its not going to be very large. Just needs to be local

sanamorii commented 1 year ago

Hi, like @JcbSm the database is probably not going to be extremely large. If you would like to get start then I was originally going to use SQLite as the db but that might be changed to mysql for sale of convenience

JcbSm commented 1 year ago

Implemented :D