Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

PlanetTeamSpeakk/Impulse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Impulse

Source code of the Impulse Discord bot.

Dependencies

Windows/Mac

Install the latest version of Java Development Kit (JDK) 8 which can be found here.

Linux

On Linux you gotta open a terminal (ctrl+alt+t) and type the following command: sudo apt-get install openjdk-8-jdk, once you've installed that make sure to also install JavaFX by running sudo apt-get install openjfx.

Sharding

If you are not planning on using shards, e.g. your bot is in less than 2500 servers, then you can ignore this. Since version 2.0 sharding has been totally revamped, instead of every shard just running in 1 process and totally defying the meaning of sharding, shards now run all in their own process and are connected to a server using Netty.

Now I hear you ask, how do I start the server and the shards? Well, simple:

Starting the server

  1. If you have not yet started the bot at least once, there is no config, do that first so a config is generated and fill it out.
  2. Set the variable 'shards' in the config to at least 2.
  3. Start the server by just double clicking the Impulse jar file, it should say starting server and give a success message a few seconds later.
  4. There you go, you just started the server! Yes, it was that easy.

Starting the clients (read shards)

  1. No config is needed here, the clients get the config from the server.
  2. On windows, make a start.bat file that is somewhat like the following:
@echo off
java -jar <jar file>.jar -shard <shardId>

Just make sure that the Impulse jar file, which is indeed the same as the server, starts the jar file with the -shard parameters and make sure to change and to the corresponding variables. Note: shard ids are index-based meaning they start at 0 and end at shardcount-1.

  1. Now repeat that for each shard.
  2. As soon as every shard is online, the server should start sending packets to each of them to tell them to log in, once they're all logged in, they will start listening to commands.
  3. That's it, you're done!

Starting the server and clients on different hosts

If you're planning on starting the server on let's say VPS 1 and you want to start the clients on a different one, or want the clients distributed over multiple hosts (read computers) then you're gonna have to follow these steps:

  1. Make sure port 62192 on the host of the server is forwarded, you can find how to do so online, but if that does not help, search on how to do it with UPnP if your router supports that.
  2. In the start file of each of the clients, you're gonna have to add -hostname <ip of the server's host> to the end of the line that starts with java -jar. You can use a custom domain and its DNS to change the ip to a domain name instead of an ip but that's unnecessary, as long as port 62192 is forwarded on the host.

Extensions

Since Impulse 2.0 you can now make your own extensions! All you need to do is the following:

  1. Create a new project in your favourite IDE.
  2. Add the latest version of Impulse to the build path.
  3. Make a class that implements com.impulsebot.utils.commands.Extension.
  4. Make sure to add the main class to the manifest in order for the extension to be able to load.

About

Source code of the Impulse Discord bot.

Resources

License

Stars

Watchers

Forks

Packages

No packages published