A Java Discord bot. Needing help

Can anyone help me with making a discord bot written in Java?

What I want to do is make a discord bot in Java to calculate averages and make a graph in regression analysis. I don’t know how to make a discord bot let alone in Java. (I have already made the discord app)

Anyone able to help or guide? Or is it even possible?

Hi @RoumakDatta , welcome back!
Would you consider Bounties, where you can hire developers to do this for you?

1 Like

Hey there Nate,

I don’t need someone to do this for me, I just need some help to see if it’s possible. I also don’t have the money for cycles. I have used the basic python template to make a bot but as it’s my first bot, and my first time trying to mix Java and python, I’m struggling.

Hey @RoumakDatta!

You could try using this video (https://www.youtube.com/watch?v=LFsxkWME7M0), but I wouldn’t recommend making a Discord Bot using Java, I would instead suggest first creating one in Python (https://www.youtube.com/watch?v=2k9x0s3awss) or JavaScript (https://www.youtube.com/watch?v=pDQAn18-2go). Here’s a Replit link that might be helpful → https://docs.replit.com/getting-started/Quickstarts/discord-bot.

I hope this helps!

Hey there,
I’ve seen this tutorial, the problem is I can’t use maven or gradle. I have a python bot but I don’t really know python that well. Is it possible to use Java within python?

@RoumakDatta try following this guide to integrate Java into Python → Integrating Java with Python - GeeksforGeeks

I’m trying it out, although Replit won’t let me install py4j,

pip install py4j

When I try this it just shows an error and nothing happens, do I but this in the console?

@RoumakDatta no you need to input it into your Shell. You can access your Shell by pressing Ctrl+Shift+S or opening a new tab in the Replit editor and typing “Shell”. I hope this helps!

Ohhhhh thanks, I’ll still keep the post open as I still need to get it working. Thanks! Also is it possible to use JDA (Java discord API) in replit?

@RoumakDatta possibly, I don’t know for certain though, it’s worth a shot.

1 Like

Wow, what a coincidence you’re here. The setup process for py4j returns an error.

from py4j.java_gateway import JavaGateway

gateway = JavaGateway()

msgObjectFromJavaApp = gateway.entry_point

print(msgObjectFromJavaApp.Message())

This returns an error,

msgObjectFromJavaApp apparently has an object type of “None” which can’t be called

I just found out that replit uses maven. Thanks for the help! It should work now.

1 Like

Hey @RoumakDatta!

Please mark the post that best helped you as the solution if it solved your problem so people with the same issue can easily find the solution.

1 Like

Update: it broke. :slight_smile:

So, I tried importing discord4J to replit but it isn’t recognised by the file. The discord4J website has no instructions I can use. I’ll go to sleep now, I just need to fix the errors

2 Likes

I need help adding the dependencies for discord4j using maven in pom.xml. When i try adding them it doesn’t import the packages

Hey there, just a question, is replit able to detect external classes and methods and instances added via packages? It keeps giving an error that I don’t know how to fix

Update: Now everything is working except certificates + it may not work behind the certificates. This is frustrating

Is there anyway to bypass certification checks? As I can’t find any way to add a certificate to my program

Are your refering to the SSL/TLS certificates of discord.com?

2 Likes

either discord.com or something to do with a package called mono im using. Im trying to use the discord4j basic bot tutorial