Jump to content
_Rocket_

Discord Bot Communication Between Servers

Recommended Posts

That's a pretty neat project :) Great job!

 

Out of curiosity, have you released any source code for this project? If not, do you plan on releasing any?

 

I made a Discord bot in Java a couple months ago here for another gaming community I was helping out with (on the technical side). I haven't worked on it much since sadly. Though, I want to keep expanding my knowledge in Java in the future. I'm honestly thinking about learning C first, though.

 

For this project, what did you use to integrate the Discord API into Java? I know there were some libraries made to make this easy (example). For the project I made, I believe I used JDABuilder from DV8tion.

 

Thanks!

  • Like 3

Share this post


Link to post
Share on other sites

35 minutes ago, Roy said:

That's a pretty neat project :) Great job!

 

Out of curiosity, have you released any source code for this project? If not, do you plan on releasing any?

 

I made a Discord bot in Java a couple months ago here for another gaming community I was helping out with (on the technical side). I haven't worked on it much since sadly. Though, I want to keep expanding my knowledge in Java in the future. I'm honestly thinking about learning C first, though.

 

For this project, what did you use to integrate the Discord API into Java? I know there were some libraries made to make this easy (example). For the project I made, I believe I used JDABuilder from DV8tion.

 

Thanks!

I did use the JDAbuilder from DV8tion, the JDA api. I know there's a different java discord api, D4J, but I never bothered with that one. I just stuck with JDA because it was the one I have always used.

If the discord bot had a little more interest, I had plans to make a tutorial series on using java to make party games, and that series would eventually show how to make lobbies and such. I might still do that in the future. I love being a teacher, so it's the kind of thing I'd enjoy doing once I find a time to make it.

If you have plans to learn C language, go right ahead. I only had 4 and a half months of experience with Java until I started to try out C++. I kind of bounce between the two languages. I use C++ for GUI projects as of right now. I mostly use java for discord bot development. It's interesting learning about new languages, so I'd most definitely recommend you look a little into C.

 

Though just for you, I'll still include a couple snips of the source code so you can catch a glimpse of it eggs dea. (I want to make a tutorial series before I release any source code of anything)

image.thumb.png.d079caaebac86f9eb982a98940cdec4d.png
 

image.thumb.png.bb061e40794294babee9dfaee545a14b.png

 

image.thumb.png.e10229303f7c50a52adfbae84e56494f.png

 

 

The code is a little messy and there was a couple of bugs, but I didn't get to fixing them by the time I scrapped the project. So if it's a little hard to follow the logic, I apologize lol.

 

Edited by _Rocket_
Added small message at the end
  • Like 1

Share this post


Link to post
Share on other sites

Will you ever release the communication bot for servers? If so I would really like to use it. 

Share this post


Link to post
Share on other sites

2 minutes ago, TheJitFace said:

Will you ever release the communication bot for servers? If so I would really like to use it. 

I don't know if I will finish any bots anytime soon. There just wasn't enough interest to make it worth the maintenence. I might eventually, but for the time being (Unless there's a sudden surge in interested folks) I won't be working on the bots.

  • Like 1

Share this post


Link to post
Share on other sites

24 minutes ago, SCP-106. said:

@_Rocket_ why do we need this again?

Lol what do you mean? If you are trying to say that this post is pointless, it's why I posted it in the interests section where the "projects" tab is. If you do not have any interest in this subject matter, then you don't have to look. I'm by no means insulted if that is why you ask, just realize this tab is here for a reason. If you posted a coding project you worked hours on, I'd be pretty interested myself.

  • Like 1
  • Winner 1

Share this post


Link to post
Share on other sites

Ew, eclipse

 

I see a lot of static methods, you should look into OOP.

I also see an improper use of packages. Java has conventions which I'd recommend following as it makes it globally easier for you, and anyone else to read. 

 

Code Conventions for the Java Programming Language: 9. Naming Conventions

  • Like 1

Share this post


Link to post
Share on other sites

1 hour ago, NCBR said:

Ew, eclipse

 

I see a lot of static methods, you should look into OOP.

I also see an improper use of packages. Java has conventions which I'd recommend following as it makes it globally easier for you, and anyone else to read. 

 

Code Conventions for the Java Programming Language: 9. Naming Conventions

Yeah, I plan on doing more research on both C++ and a little Java after I finish developing the game I'm working on. I'm not quite for sure how I should use packages quite yet because it's something I haven't looked into very much. Mainly because I've done research almost exclusively on C++ for 6 months now haha.

Share this post


Link to post
Share on other sites

4 hours ago, RivalRevival said:

@Ben could help you with it, given he wants to. The dude is a whiz at these kinds of bots. Example being our moderation and utility bots

I'm only whiz at setting up discord bots to just host and modifying them in areas that I know. Java is not in my areas.

Share this post


Link to post
Share on other sites

4 hours ago, Ben said:

I'm only whiz at setting up discord bots to just host and modifying them in areas that I know. Java is not in my areas.

If you were ever interested, I could help you out with a little on Java. If you have any experience with any C language, learning the basics of Java is pretty simple and shouldn't take you more than a day. However there are a few libraries that won't be exposed to you very quickly in tutorials on YouTube that could help you out with a few things. If you ever want to get started on Java let me know, I wouldn't mind helping you out a little bit so you don't have to worry about dealing with YouTube tutorials and stack overflow lol.

Share this post


Link to post
Share on other sites

4 minutes ago, SCP-106. said:

@_Rocket_ hey is java like command prompt

@SCP-106. The command prompt is a way to communicate with your PC and is in no way related to any programming language of any kind. You can run programs made in java using the command prompt if you have the Java JDK. But no, java is a programming language that can make console applications, GUI applications, Android apps, etc.

  • Thanks 1
  • Winner 1

Share this post


Link to post
Share on other sites

@SCP-106. Uh... no? Java isn't used for addons in Gmod if that's what you mean. Lua is what's used for those things. Java is mainly used for Android development and some GUI applications. There are some other uses for Java, but you will see java used for a lot of android app development. I use Java for discord bot development.

  • Winner 1

Share this post


Link to post
Share on other sites

On 8/24/2019 at 6:55 AM, Noctember said:

Ew, eclipse

 

I see a lot of static methods, you should look into OOP.

I also see an improper use of packages. Java has conventions which I'd recommend following as it makes it globally easier for you, and anyone else to read. 

 

Code Conventions for the Java Programming Language: 9. Naming Conventions

I don' think there is anything wrong with static methods (and they are a part of OOP too?). I do see your point with the user manager. It's easier to code a "static" singleton, but, yea, for testing and reusability a more encapsulated approach might be better.

Share this post


Link to post
Share on other sites

To anyone who follows this post, here's a link to the first tutorial video on how this works and how to make it.

 

Share this post


Link to post
Share on other sites

I am currently working on a project that uses this in case you all didn't know. I am working with a friend to write a "casino" discord bot. You can find more information on that on the post recent post in this projects forum.

 

In the meantime, I wanna show you a snip of the first database code I wrote when I made my first multi-server communication/lobby system. This is responsible for getting things saved into the database. I think this was pretty clean for database code. I believe I actually took this snap a few months ago haha.downloadfile.thumb.jpg.5f95071fc6f7a1b79e6a9e3dfb9a7d25.jpg

Share this post


Link to post
Share on other sites

Before you start screaming "Necro poster!" Here me out. This would be kind of pointless to make a whole new topic on (at least for now). I have been learning a lot more about Java ever since I made this forum post. I have refined my lobby system and greatly improved its efficiency.

 

I have a new idea. What if I made my very own library that people can use? This library would be the entire lobby system. I would structure the code to be easy to understand and use after a quick tutorial video. This would allow JDA users to easily make multiplayer games, lobbies, etc.

 

I would likely start working on this once I finish the GFL game. And this would allow any JDA programmer to easily make multiplayer game bots without the pain of making the actual system.

 

What do you guys think about this? I think this could be a good library. And it would be a learning experience for me.

Share this post


Link to post
Share on other sites

This will be the last post I make in this topic (I promise lol). Just wanted to let you all know that I developed a library that you all can use to make your own discord bot that uses the Lobby System technology. cya bois

 

Share this post


Link to post
Share on other sites

Hey there everyone. So I would like to update everyone on what I'm doing now.

 

I am making a .dll library for this lobby system! This will be designed to be bindable with many different languages. This will give all the various discord APIs the means to utilize this technology. In other words, this technology will no longer be limited the JDA.

 

The library will be written in C++. This is so it can utilize dynamic arrays and a few other tools. But due to how binding works, a lot of the code will be C style.

 

Once complete I will be learning more of Lua, Python, and JavaScript so I can cover how to properly use this library in all the different languages. In the meantime I will be testing the API using Java since it's the language I know the most about (when compared to Python, Lua, and JS)

 

Special thanks to @Xy for coming up with this idea. When I told him about this project, he said I could try doing something like this. Now I'm doing it.

 

If you wish to see a little bit of the code and it being put into action, here's some examples:

 

https://pastebin.com/LPARG5UX

https://pastebin.com/ZYqxkZW6

 

And the result:

unknown-3-1.png.6155f9caf739683acfcf7b55e488c138.png

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...