PHP code example of 1337m / lemming

1. Go to this page and download the library: Download 1337m/lemming 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/ */

    

1337m / lemming example snippets




return [
    'gif' => [
        'action' => Lemming\Giphy\Command::class,
        'aliases' => ['giphy', 'moving-picture'],
        'description' => 'Search the big database, of GIFs, and return the matching result.',
        'usage' => '/gif [phrase]',
    ],
];




namespace MyAwesomePlugin;

use Lemming\Command\Base;

class MyAwesomeCommand extends Base
{
    public function fire()
    {
        return 'AWESOME!';
    }
}




return [
    'awesome' => [
        'action' => MyAwesomePlugin\MyAwesomeCommand::class,
    ],
];




namespace MyAwesomePlugin;

use Lemming\Command\Base;

class RandomCommand extends Base
{
    public function fire()
    {
        if (empty($this->params)) {
            return 'Nothing to pick from...';
        }
        
        shuffle($this->params);
        
        return $this->message->channel->sendMessage('Personally, I would go with: ' . $this->params[0]);
    }
}




return [
    'random' => [
        'action' => MyAwesomePlugin\RandomCommand::class,
    ],
];