DiscordBotAPI 1.1.1

Discord to server/bungee bridge. Used with plugins that depend/softdepend this resource

  1. Joshb_
    Native Minecraft Version:
    1.16
    Tested Minecraft Versions:
    • 1.8
    • 1.9
    • 1.10
    • 1.11
    • 1.12
    • 1.13
    • 1.14
    • 1.15
    • 1.16
    Source Code:
    https://github.com/HMJosh/DiscordBotAPI
    This plugin was developed for the sole use in my own plugins/plugins I contribute to. It is a basic discord API without any extra BS! I do not suggest downloading this plugin if you do not own my plugins.

    Why did I make this instead of using DiscordSRV?
    DiscordSRV does not support bungee use. I really needed bungee support with my plugin to function properly. So I'm not stealing heat or anything. I need a reliable and compatible API that supports my needs. However, DiscordSRV is an amazing plugin. Check it out here (https://www.spigotmc.org/resources/discordsrv.18494/)

    !!!!!LOOK HERE!!!!!
    Creating a Discord Bot and getting its Bot-Token for the config:

    1. Create an application at https://discordapp.com/developers/applications/
    2. On the application's page, go to the "Bot" tab, click "Add Bot", and confirm.
    3. Scroll down to the bottom of the bot page and enable Server Members Intent.
    4. Click the copy button under "Token" on the bot tab.
    5. Copy and paste the token to your settings.yml
    6. Invite the bot to your discord server using the bot link
    7. done :D


    Features:
    - Account Link/Unlink with Minecraft.
    - Easy link process.
    - That's it!

    Commands:
    - /discord - main plugin command. Fully customizable messages
    - /discord link - sends you instructions to link your account to discord.
    - /discord unlink - sends you instructions to unlink your account from discord.

    Permissions:
    - discordbotapi.command.discord
    - discordbotapi.command.discord.link
    - discordbotapi.command.discord.unlink

    Note:
    - All API Methods/commands/permissions are identical to the server/bungee version. Just drag and drop the plugin into either plugin folder and enjoy.

    - Do not reload this plugin. I will add a reload command for messages later. But don't reload the plugin. Restart your server once you made your changes.

    Screenshots:
    When the account is linked:
    [​IMG]

    Not linked:
    [​IMG]

    /discord link
    [​IMG]

    All messages are fully customizable:

    Code (Text):
    Discord:
      PM-Command-Only: '%[email protected]%, The link command can only be ran in PM"s.'
      No-Code-Generated: 'There is not code generated for this account. You must run /discord link in game to get started.'
      Wrong-Code: 'That code does not match our records. Please try again.'
      Account-Linked: 'You account has been linked! At any time, use "/discord unlink" in game to unlink your account.'
    Game:
      Prefix: '&7[&cDiscordBot&7]'
      Commands:
        No-Permission: '%prefix% &cYou do not have permission to use this command.'
        Player-Only-Command: '&cConsole can not run this command.'
        Discord:
          Not-Linked:
            - ''
            - '&3Join our discord! &e(invite link)'
            - ''
          Linked:
            - ''
            - '&aYour account (&e%player%&a) is linked with discord (&e%discord_author_name%#%discord_author_discriminator%&a)'
            - '&c(your invite link here)'
            - ''
          Sub-Commands:
            Link:
              Not-Linked:
                - ''
                - '&e%player%&a, you can link your account on our discord!'
                - '&e(invite link)'
                - ''
                - '&aInstructions:'
                - '&a- P.M &e%discord_bot_name% &awith this command:'
                - '&e  %command_prefix% link %code%'
                - '&a- That"s it!'
              Linked:
                - ''
                - '&aYour account (&e%player%&a) is linked with discord (&e%discord_author_name%#%discord_author_discriminator%&a)'
                - '&c(your invite link here)'
                - ''
            Unlink:
              Not-Linked:
                - ''
                - '&e%player%&a, your account is not linked on our discord!'
                - '&e(invite link)'
                - ''
              Linked:
                - ''
                - '&aYour account (&e%player%&a) has been unlinked with discord (&e%discord_author_name%#%discord_author_discriminator%&a)'
                - '&c(your invite link here)'
                - ''

    Developers:
    Want to use this plugin for discord integration?

    Maven:
    Add this to your POM:
    Code (HTML5):
    <repository>
          <id>jitpack.io</id>
          <url>https://jitpack.io</url>
    </repository>
    Code (HTML5):
    <dependency>
        <groupId>com.github.HMJosh</groupId>
        <artifactId>DiscordBotAPI</artifactId>
        <version>Tag</version>
    </dependency>
    Usage:
    This API simply builds you a JDA bot instance.

    First you should check if the plugin is installed before you start calling methods from DiscordBotAPI
    Code (Java):
    if(Bukkit.getPluginManager().getPlugin("DiscordBotAPI") != null){
        //initalize classes here
    }
    (same goes for bungee plugins)

    Then you can use the DiscordBotAPI methods:

    Code (Java):
    DiscordBotAPI.getJDA()... //The jda object
    It's good to use my methods for registering events:
    Code (Text):
    DiscordBotAPI.plugin.registerEvent(this, new DiscordMessageListener());

    //This is so I can handle stuff in the future. I.E Disable listeners that cause issues... etc
     
    If not, register your listeners with jda
    Code (Java):
    DiscordBotAPI.getJDA().addEventListener(listenerClass);
    Account Manager:
    This is used for the linking process of accounts. You can use any method here, but I suggest you ONLY use the get methods to not cause issues with linking/unlinking accounts. Let my plugin do the work. (getUUID, and getDiscordID)

    Code (Java):
    DiscordBotAPI.getAccountManager()...
    It's pretty simple. No extra events and such. Just link and unlink. Wants something added? Let me know!

Recent Updates

  1. 1.1.1
  2. 1.1.0
  3. 1.0.8

Recent Reviews

  1. Songgthu
    Songgthu
    5/5,
    Version: 1.1.1
    can it work in 1.18.2?plugin works great in versions 1.17 but I haven't tested on 1.18
  2. WichtigerLenni
    WichtigerLenni
    3/5,
    Version: 1.1.1
    The API is not working afaik
    I do not find the dependency in the pom xd
    Please fix this!
    1. Joshb_
      Author's Response
  3. WesleyH51
    WesleyH51
    5/5,
    Version: 1.1.1
    Works as intended. Simple, easy, lightweight, works on bungee. Easy API for anyone to understand. If possible, could you add Velocity support aswell? Thanks :)
  4. Hadus
    Hadus
    4/5,
    Version: 1.1.1
    Has this been updated to 1.17? I'd like to update my server soon but this is one of the few remaining plugins.
    1. Joshb_
      Author's Response
      It should already work. Have you tested it?
  5. TecnoFra
    TecnoFra
    4/5,
    Version: 1.1.1
    I do not find the dependency in the POM...
    ________________________________________________
    1. Joshb_
  6. Romanrf34
    Romanrf34
    5/5,
    Version: 1.1.1
    Great
    ______________________________
    ______________________________
    ______________________________
  7. IPenguinI
    IPenguinI
    5/5,
    Version: 1.1.1
    Cool


    --------------------------------------------------------------------------------
  8. TheDoominator
    TheDoominator
    5/5,
    Version: 1.0.6
    ----------------------------------
    epicness
    -------------------------------------
    1. Joshb_
      Author's Response
      Thanks :D