Skip to content

Small java server with DB included to easily create commands for Niobio Cash bot.

Notifications You must be signed in to change notification settings

soldate/MyServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a simple command implementation for WhatsApp, using Niobio Cash (NBR) bot.

The basic idea is (read all first before start doing it):

  1. Add WhatsApp bot +55 61 8220-9940 to your WhatsApp contacts

  2. Create your server (valid ip). If you dont have, you can create here https://m.do.co/c/1ac0e19b0bcd

TIP: Pickup the minimal machine (low cost after free period. 5$), install 4gb of swap memory https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-16-04 prefer NYC for fast network ping

  1. Fork this repository https://github.com/soldate/MyServer

  2. In your server terminal: type: git clone yourforkrepository (or https://github.com/soldate/MyServer)

  3. Run this small java server (java -jar prod/server.jar). Try see in browser yourserverip:port (Default port is 80, dont use http or https, is always http)

  4. Send a WhatsApp message to create a command: /createcmd yourcommand yourserverip:port (ex: /createcmd helloworld 45.53.141.200)

  5. Send a WhatsApp message: /yourcommand (ex: /helloworld)

  6. In an web browser, go to http://yourserver:port (press F5) and see if your server receive the message => text="Comando nao encontrado" (command not found)

  7. Develop (see below) your command in src/your/YourMain.java, generate and run a new server.jar, and try send /yourcommand again

--------- To develop: ---------------

You need Java (JDK for run jar command, not only JRE) and Git.

Probably you should use Eclipse editor. (read all first before start doing it):

  1. Open your terminal and go to your workspace. (ex: c:\workspace)

type: git clone yourforkrepository (or https://github.com/soldate/MyServer)

  1. In Eclipse, go to Import.. Git.. Exisitng.. find c:\workspace\MyServer

Open src/your/YourMain and play a little.

IMPORTANT: The real void main is in jetty.Server class. You should probably use Show View -> Git Staging to see your changes

  1. So, to run go to (Eclipse) menu Debug -> Server class (not "on Server")

  2. When is ready, generate new server.jar

Open terminal and go to c:\workspace\MyServer\bin

execute: jar cfm ..\prod\server.jar ..\META-INF\Manifest.txt * ..\lib

  1. git push

  2. in your server terminal.

git pull

java -jar prod/server.jar

  1. try again :-D

About

Small java server with DB included to easily create commands for Niobio Cash bot.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages