1. Go to this page and download the library: Download skinnybot/skinny 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/ */
skinnybot / skinny example snippets
namespace Bot\Module\Modules;
use Skinny\Module\ModuleInterface;
use Skinny\Network\Wrapper;
class Basic implements ModuleInterface
{
/**
* {@inheritDoc}
*
* @param \Skinny\Network\Wrapper $wrapper The Wrapper instance.
* @param array $message The message array.
*
* @return void
*/
public function onChannelMessage(Wrapper $wrapper, $message)
{
}
/**
* {@inheritDoc}
*
* @param \Skinny\Network\Wrapper $wrapper The Wrapper instance.
* @param array $message The message array.
*
* @return void
*/
public function onPrivateMessage(Wrapper $wrapper, $message)
{
}
/**
* {@inheritDoc}
*
* @param \Skinny\Network\Wrapper $wrapper The Wrapper instance.
* @param array $message The message array.
*
* @return void
*/
public function onCommandMessage(Wrapper $wrapper, $message)
{
}
}
public function onCommandMessage(Wrapper $wrapper, $message)
{
switch ($message['command']) {
case 'say':
$wrapper->Channel->sendMessage($message['parts'][1]);
break;
}
}