marcusyan / botman-driver-discord
A discord driver for botman
1.0.2
2019-03-25 15:08 UTC
Requires
- php: >=7.1
- botman/botman: ~2.0
- charlottedunois/yasmin: v0.5.1
- illuminate/support: ^5.7
This package is auto-updated.
Last update: 2025-02-17 06:51:26 UTC
README
Getting Started
Require the driver into your botman project composer require jabirchall/botman-driver-discord
Example
$config = [ 'discord' =>[ 'token' => "your token", ], ]; // Load the driver(s) you want to use DriverManager::loadDriver(\JABirchall\BotMan\Drivers\Discord\DiscordDriver::class); $loop = Factory::create(); $botman = BotManFactory::createForDiscord($config, $loop); // Give the bot something to listen for. $botman->hears('hello', function (BotMan $bot) { $bot->reply('Hello yourself.'); }); // start a convosation $botman->hears('How are you', function (BotMan $bot) { $bot->ask("I'm a bot I have no feelings, How about you?", function (Answer $answer) use ($bot) { $bot->reply("Thats great, you said: ". $answer->getText()); }); }); // Start listening $botman->listen(); $loop->run();
Prerequisities
- Botman 2.*
- PHP version 7.1+
- mbstring
- A discord bot token
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
Authors
- JABirchall - Maintainer
See also the list of contributors who participated in this project.
License
This project is licensed under GNU AGPLv3 License - see the LICENSE file for details