Discord Linking to MYSQL database

Discussion in 'Plugin Requests' started by NickGames8029, May 4, 2023.

Thread Status:
Not open for further replies.
  1. Offline

    NickGames8029

    Hello I would like a simple plugin with a command "/link {discord}"

    EXAMPLE:
    /link Oefen#8029

    and it would link their IGN to their discord in a MYSQL database.

    TABLE NAME: discordlinking
    INFO: UUID,IGN,DISCORDTAG (Example: 28f25bcdc60b4ef59903506dc67a0fc4,Oefen,Oefen#8029)

    and if they do /link again with a different discord it just simply updates. This would be cool, Thanks!
    (Also CONFIG would be nice to change MYSQL details ofc)

    VERSION: 1.8.x
     
    Last edited: May 4, 2023
  2. Offline

    liltinyten

    Could you tell me what you need to use this for? Depending on what the plugin is for, you will also need a way to verify a player's Discord account.
     
  3. Offline

    NickGames8029

    It’s for a Ranked SkyWars server. I’m a developer there, and I’ve made a discord bot with stats and stuff. Only thing is. I’m not that great at plugins. I just want an easy way for people to verify their discord to their ingame name so I can make sure if they do their discord tag shows up with the stats so people know who it is. This only requires me to search in the database for their UUID/IGN and grab their linked discord. It’s just more simple if people could link you know?
     
  4. Offline

    timtower Administrator Administrator Moderator

    @NickGames8029 Considered having the plugin just post a link to a website?
    Like <yourwebsitehere>/register/<uuid of the player>
    Then handle everything on the site?
     
  5. Offline

    NickGames8029

    That seems like a lot more trouble and honestly I wouldn’t know how to do that. A plugin connected to a database is all I can think of that would work flawlessly. I’ve already tried looking up an plugin where you can store placeholders to databases but found nothing. If that was the case then I could easily make a custom placeholder for their discords and sent it to an database.

    EDIT: I just noticed what you mean. You mean like an API? We had that but it was removed by another developer because we changed skywars plugins. And this is sadly not an option anytime soon since everyone is quite busy.
     
  6. Offline

    timtower Administrator Administrator Moderator

    User needs to verify his discord somewhere, how would that work?
     
  7. Offline

    NickGames8029

    With a plugin where they can do “/link {Example#0001}” and then it stores the discord with their uuid and ign in a database. And then i grab the info from the database.
     
  8. Offline

    timtower Administrator Administrator Moderator

    That is not making sure that the right discord is linked to the right Minecraft account. (Verification)
     
  9. Offline

    NickGames8029

    Yes it is. Why would someone link anothers discord?
     
  10. Offline

    timtower Administrator Administrator Moderator

    No, it is just the linking itself.
    And people are trolls, that is how it is in this world.
     
  11. Offline

    NickGames8029

    It works out with the plugin though, and our community will not abuse it in any bad way. I don't see how it could be abused anyways. It's just so people can link their accounts, For me a simple plugin that sents data to a mysql database works out. I would be extremely happy if that's possible. :)
     
  12. Offline

    AntTheAntster

    Last edited: May 11, 2023
  13. Offline

    timtower Administrator Administrator Moderator

  14. Offline

    AntTheAntster

    It was something I quickly threw together under the assumption that the OP would want all his players to link their discord therefore I just register the players UUID and Name into the Database upon joining but the DISCORD section of the DB is kept null for obvious reasons.

    If the OP would like this amended then I can do so as that's a literal copy/paste fix.
     
  15. Offline

    timtower Administrator Administrator Moderator

    INSERT ON DUPLICATE KEY UPDATE
    Would use that one myself, with a primary key on the UUID so you don't get silly things.
    Also removes the need for the exists check in the onJoin.
     
  16. Offline

    AntTheAntster

    Interesting I didn't think to use 'INSERT ON DUPLICATE KEY UPDATE'.
    And I tend to use Name as a primary key rather than the UUID because I had a bad experience with UUID's being the primary key in the past although it is probably better practice to use UUID's.
     
  17. Offline

    timtower Administrator Administrator Moderator

    Names change, UUID not.
     
Thread Status:
Not open for further replies.

Share This Page