1. Go to this page and download the library: Download eurobertics/nebucord library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
Nebucord\Nebucord;
class MessageInterceptorClass {
public function onMessageReceive($evt) {
// $evt is a model with all data from the gateway if a message create
// event is received
echo $evt->content; // returns the message
}
}
$nebucordEventTable = \Nebucord\Events\EventTable::create();
$nebucordEventTable->addEvent(new MessageInterceptorClass, "onMessageReceive", \Nebucord\Base\StatusList::GWEVT_MESSAGE_CREATE);
$nebucord = new Nebucord(['token' => 'your_bot_token', 'ctrlusr' => ['controluser-snowflake1', 'controluser-snowflake2']]);
$nebucord->bootstrap()
->setEventTable($nebucordEventTable)
->run();