Laracord is a micro-framework that provides a beautiful starting point for your next Discord bot.
Build functional, elegant bots harnessing the full power of Laravel alongside DiscordPHP.
Laracord utilizes Composer for managing dependencies. Before using Laracord, please ensure you have Composer installed on your machine.
The following PHP extensions are also required:
Before creating your first Laracord project, make sure that your local machine has PHP and Composer installed.
After you have installed PHP and Composer, you may create a new Laracord project via Composer's create-project
command:
$ composer create-project laracord/laracord
$ cd laracord
In order to run the Bot, you will have to create an Application using the Discord Developer Portal and obtain a bot token.
By default, the Bot will also require you enable the necessary Intents.
These can be found and enabled in the developer portal under Settings > Bot > Privileged Gateway Intents
.
Once you obtain a bot token, you can configure it inside of .env
:
DISCORD_TOKEN=...
To boot your bot, simply run laracord
with no arguments passed:
$ php laracord
When booting Laracord using a bot token that is currently not in any servers, Laracord will automatically output an invite link in console for convenience.
For convenience, Laracord comes with a console command to set a specified user as admin using their Discord ID:
$ php laracord bot:admin <id>
Laracord comes with full support for Tinker out of the box.
$ php laracord tinker
To view all built-in console commands, you can run the list
command:
$ php laracord list