Installation

Clone this reposistory and use this command. You need NodeJS to run this project.

npm install

After that, edit the script.json file with your bot token and some data! You can check the example_script.json file if you want!

The bot need some permission. You can use the button in the web dashboard to invite with the needed permission!

Synthax

{
	"name-of-the-command" : "Response",
	"other-command" : ["Choose", "one", "response"],
	"custom-params" : "%me% use Pikachu",
	"command" : {
		"subCommand1" : "Execute when user send '!command subCommand1' ",
		"subCommand2" : "Execute when user send '!command subCommand2' "
	}
}

Customs Parameters

You can define some customs parameters whitch is replaced by something :

Date & time :

Channel:

Server:

Exemple :

In the code

{
	"!test" : "%me% : %all%",
	"!hug" : "%me% hug %1%
}

In Discord

Bigaston > !test I like potatoe
EasyBot > Bigaston : I like potatoe

Bigaston > !hug Bob
EasyBot > Bigaston hug Bob

Bigaston > !hug
EasyBot > Bigaston hug nothing

Options

You may define some bot settings in the JSON doc:

(* : Required!) (# : Required for some event!)

Exemple :

In the code

{
	"@prefix@" : "!",
	"test" : "Detected!"
}

In Discord

Bigaston > !test
EasyBot > Detected!

Bigaston > test

Custom Events

You may use custom events to send a message when triggered :

Exemple :

In the code

{
	"test" : "This is a test!",
	"hi" : {
		"monday" : "It's monday!",
		"#errorCommand#" : "You need to specify a day!"
	},
	"other-test" : {
		"yes" : "YES!!",
		"#errorCommand#" : "You need to specify an argument!",
		"#default#" : "You choose the default branch with %1%"
	}
	"#errorCommand#" : "No command like this!",
}

In Discord

Bigaston > !test
EasyBot > This is a test!
Bigaston > !shlagvug
EasyBot > No command like this!

Bigaston > !hi monday
EasyBot > It's monday!
Bigaston > !hi
EasyBot > You need to specify a day!

Bigaston > !other-test
EasyBot > You need to specify an argument!
Bigaston > !other-test yes
EasyBot > YES!!
Bigaston > !other-test 123
EasyBot > You choose the default branch with 123

Custom action

When you write some of this in your response, they will do some action and be ereased!

Web request

You can trigger some event with the EasyBot API. For that you need your API Token (you can find it in the dashboard), after that just send a POST request to the URL of your event.

URL is like : [yourDomaineAndPort]/api/[theNameOfYourEvent]?t=[yourAPIToken]

You can use the %web:{body_key}% parameter to replace it with your POST request body.

You need to specify a channel with !channel:send[id]! ! Or the bot will not send message!

You can use Random parameters and Game event!

Example :

POST REQUEST to yoururl.me:6000/api/test?t=123456789 with body:

{
	"name" : "Machin"
}

Script :

{
	"?test?" : "Hello %web:name%! !channel:send[123456789]!"
}

In Discord, in the channel with id 123456789

EasyBot : Hello Machin!