CHDiscord tutorial?

Discussion in 'CommandHelper' started by Oboist, Nov 3, 2018.

  1. Oboist

    Oboist Member

    Just found this marvelous thing. Want this on my server badly, but, honestly, never had experience in using discord bots at all. Can someone explain "step by step", what should I do to get a working server bot?

    Made an app on Discord dev portal, added a bot to it, added this bot to discord server, copied bot token and server id, but using
    Code (Text):
    discord_connect('NTA4MzYwNTI5MzE2OTM3NzI5.Dr-UVQ.NfeZN8j9NoFlmvMPmiVZFyM1E0Y', 482861358149271552);
    discord_broadcast('Im ALIIIIVEE!');
    returns "Failed to connect. Verify your token is accurate." exception.

    Maybe someone have experience in that field?
  2. Oboist

    Oboist Member

    Oh, and is it normal that every time i go to app page/bot "copy token" button gives different value (not even using "Regenerate")?
  3. PseudoKnight

    PseudoKnight Well-Known Member Developer

    I don't think so. That doesn't happen to me with the bot token.

    As for the error, that shouldn't happen. It's a NoClassDefFoundError within the JDA library I'm using to connect to Discord. It's never happened to me, but I have a report by one other person that it happened to them. They thought it might be because the their token was wrong, so I added a more helpful error to ensure people added the token correctly. But it turned out it was something to do with them using Spigot and it not having the logging library JDA was using (unlike Paper, which is what I was testing on). However, I fixed that in 1.2.1!

    Make sure you're using the bukkit build, not the cmdline build. Also, it won't be connected immediately. I'm adding a callback in the next version, but I'm still working on some details. But in the current version you can't put a broadcast message in the same tick as the connection.
  4. Oboist

    Oboist Member

    Thank you!
    You're right, i just downloaded wrong version. So stupid.
    And thank you for amazing extension! Definitely will use it a lot =)
  5. Oboist

    Oboist Member

    Will it eventually have a method to close bot connection? Now it stays 'online' in discord even if server stopped.
  6. PseudoKnight

    PseudoKnight Well-Known Member Developer

    I'm adding a disconnect function in the next version, but I haven't checked if that sets the bot to offline status. That might be a good thing to add if it does not.
  7. LadyCailin

    LadyCailin Administrator Developer