idevelopthings / laravel-twitch-irc
This is my package laravel-twitch-irc
Fund package maintenance!
iDevelopThings
Requires
- php: ^8.0
- amphp/websocket-client: ^1.0
- bensampo/laravel-enum: ^4.1
- illuminate/contracts: ^8.73
- spatie/laravel-package-tools: ^1.9.2
Requires (Dev)
- nunomaduro/collision: ^5.10
- nunomaduro/larastan: ^1.0
- orchestra/testbench: ^6.22
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2024-10-09 23:00:36 UTC
README
Twitch IRC Bot for laravel applications. This ships with the ability to create custom commands for your bot, with aliases, cooldowns, ability to connecto to multiple channels, etc.
Installation
You can install the package via composer:
composer require idevelopthings/laravel-twitch-irc
You can publish the config file with:
php artisan vendor:publish --tag="twitch-irc-config"
Usage
Publish the config file first, add to your .env:
TWITCH_BOT_USERNAME="your bots username" TWITCH_BOT_ACCESS_TOKEN="your bots token"
You can obtain a token here: https://twitchapps.com/tmi/ When using the token, don't include the "oauth:" prefix.
Now we can create a command, the default location is app/Services/TwitchIrc/Commands, you can change this path in the config file
<?php namespace App\Services\TwitchIrc\Commands; use TwitchIrc\Bot\Command\BaseCommand; class HelloWorldCommand extends BaseCommand { public function identifier(): string { return "hello"; } public function aliases(): array { return [ 'hi', 'hw', 'helloworld', ]; } public function description(): string { return "Responds with hello world."; } public function handle(): void { $this->reply('Hello world.'); } }
Now you can run "php artisan twitchbot" to start the bot. We can also use "php artisan twitchbot --stop" to stop the bot, which is useful for CI setups.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.