Skip to content
Open

v3 #134

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
145 commits
Select commit Hold shift + click to select a range
6f0ded6
➕ Add `illuminate/log` to the project
Log1x Feb 6, 2025
2aa5266
🔧 Create a default `logging.php` config
Log1x Feb 6, 2025
70faca1
🔧 Remove deprecated `discord.php` configuration
Log1x Feb 6, 2025
8caee21
🧑‍💻 Create a global `laracord()` helper
Log1x Feb 6, 2025
fc58fa5
🚚 Rename the `CanAsync` trait to `HasAsync`
Log1x Feb 6, 2025
dc033cf
🚚 Move the `ResolvesUser` trait
Log1x Feb 6, 2025
ddfcbe7
🚚 Rename `Http\Server` to `Http\HttpServer`
Log1x Feb 6, 2025
4c18cc6
🏗️ Move application command logic to a trait
Log1x Feb 6, 2025
c172f88
🏗️ Move command logic to a trait
Log1x Feb 6, 2025
7696505
✨ Implement component discovery
Log1x Feb 6, 2025
81b6285
🏗️ Movecontext menu logic to a trait
Log1x Feb 6, 2025
7cc62ab
🏗️ Move event logic to a trait
Log1x Feb 6, 2025
063d405
🏗️ Move service logic to a trait
Log1x Feb 6, 2025
8142416
🏗️ Move slash command logic to a trait
Log1x Feb 6, 2025
1ebc912
✨ Add interaction middleware support
Log1x Feb 6, 2025
d6a6f3f
✨ Add middleware to commands (Fixes #121)
Log1x Feb 6, 2025
22f3de0
🛂 Move the permission denied message into a future hook
Log1x Feb 6, 2025
150d609
✨ Add sharding configuration support
Log1x Feb 6, 2025
5d11f78
🧑‍💻 Improve HTTP server middleware support
Log1x Feb 6, 2025
81b6b56
✨ Create a custom console implementation using React streams
Log1x Feb 6, 2025
e333492
✨ Implement command middleware registration and resolving (Fixes #121)
Log1x Feb 6, 2025
30bd533
🧑‍💻 Create a `make:prompt` command to create console prompts
Log1x Feb 6, 2025
f26543e
🧑‍💻 Improve the default component stubs
Log1x Feb 6, 2025
7d6bee6
🛂 Resolve the user during the authorize token middleware (Supersedes …
Log1x Feb 6, 2025
79af752
🔥 Remove deprecated HTTP kernel configuration
Log1x Feb 6, 2025
6de3d7f
🔊 Implement proper logging support
Log1x Feb 6, 2025
be34332
🧑‍💻 Make `logger()` available in the `HasLaracord` trait
Log1x Feb 6, 2025
3050e91
🚚 Move the `RouteServiceProvider` to the `Http` namespace
Log1x Feb 6, 2025
eff03c7
🧑‍💻 Update the `Message` class to utilize the logger
Log1x Feb 6, 2025
c66d738
🧑‍💻 Create a `Message` facade to use the message builder from the con…
Log1x Feb 6, 2025
fb02b42
🔥 Remove deprecated middleware
Log1x Feb 6, 2025
6066b66
✨ Allow passing token/sharding during boot
Log1x Feb 6, 2025
abffcc7
✨ Add plugin support (Fixes #64)
Log1x Feb 6, 2025
8208715
✨ Add DI support to `handle` methods on components (Supersedes #129)
Log1x Feb 6, 2025
fc6394b
✨ Add support for eager handling services on boot (Supersedes #129)
Log1x Feb 6, 2025
576f559
🎨 Remove unnecessary `WithLog` trait from `Console\Commands\Command`
Log1x Feb 6, 2025
000a051
🎨 Change the `Event` class to the `HasLaracord` trait
Log1x Feb 6, 2025
f83c300
🧱 Handle command middleware in slash commands
Log1x Feb 6, 2025
8768d50
🧱 Handle command middleware in commands
Log1x Feb 6, 2025
38554a9
🧱 Handle command middleware in context menus
Log1x Feb 6, 2025
5f99601
🎨 Improve the default `!help` command
Log1x Feb 6, 2025
9590b54
🏗️ Move the loop logic to a trait
Log1x Feb 6, 2025
cc1c5bf
🧑‍💻 Add support for resolving hooks through the container
Log1x Feb 6, 2025
27affa7
✨ Create initial default console prompts
Log1x Feb 6, 2025
b5ce734
🏗️ Dramatically improve registration within the container
Log1x Feb 6, 2025
0112f6d
♻ Refactor the `Laracord` class (Fixes #67)
Log1x Feb 6, 2025
4520a7b
🚨 Run Pint
Log1x Feb 6, 2025
93f46e8
🔧 Add missing `make:prompt` command registration
Log1x Feb 6, 2025
39034cf
🩹 Change to proper `Discord` class
Log1x Feb 6, 2025
39b90da
🩹 Change to proper `Console` class
Log1x Feb 6, 2025
8230fe4
🩹 Add missing import
Log1x Feb 6, 2025
b385e49
🩹 Add missing imports
Log1x Feb 6, 2025
7d9dbe2
🎨 Improve sharding support
Log1x Feb 6, 2025
b1acc69
🎨 Disable the HTTP server when sharding
Log1x Feb 6, 2025
bdcb290
💄 Show the shard ID on boot if sharded
Log1x Feb 6, 2025
0053ed7
🧑‍💻 Improve HTTP server configuration
Log1x Feb 6, 2025
46bb0fa
🩹 Fix Windows support
Log1x Feb 6, 2025
82a1fb2
🎨 Improve docblock wording
Log1x Feb 6, 2025
2883670
🔒 Show an alert when using `--token`
Log1x Feb 7, 2025
6a4d204
🎨 Make `registerInteractions` public
Log1x Feb 7, 2025
8895940
🎨 Improve the command middleware stub docblock
Log1x Feb 7, 2025
b518c25
🎨 Add missing return type
Log1x Feb 7, 2025
c279db9
🩹 Fix call to `discord()`
Log1x Feb 7, 2025
5d10212
🩹 Fix application command registration
Log1x Feb 7, 2025
54f3d10
🚨 Run Pint
Log1x Feb 7, 2025
5f46e4e
🩹 Fix context menus
Log1x Feb 7, 2025
a9777cf
💄 Add slash commands to the commands table
Log1x Feb 7, 2025
011b0ec
🔧 Resolve the storage path with `laracord_path()`
Log1x Feb 7, 2025
89aee7f
🔧 Improve storage path handling
Log1x Feb 7, 2025
39a82bb
✨ Add hook registration
Log1x Feb 7, 2025
de47f9c
💄 Improve the token alert message
Log1x Feb 7, 2025
1e24a8a
🎨 Improve user model handling
Log1x Feb 7, 2025
62b33b4
🚨 Run Pint
Log1x Feb 7, 2025
e0e5345
✨ Implement an initial non-blocking file logging channel
Log1x Feb 8, 2025
04ea457
⬆ Bump dependencies
Log1x Feb 8, 2025
2a2dc36
🔧 Windows sucks
Log1x Feb 8, 2025
6f70695
➕ Add `illuminate/mail` to the project
Log1x Feb 8, 2025
aed2edf
🔧 Register the `MailServiceProvider` (Fixes #53)
Log1x Feb 8, 2025
15b17f8
🧑‍💻 Improve logging on Windows
Log1x Feb 8, 2025
260a40c
🚚 Rename `LoggerHandler` to `LoggingHandler`
Log1x Feb 8, 2025
38e0709
🧑‍💻 Add support for overriding the denied application command handler
Log1x Feb 8, 2025
59c9d5a
🧑‍💻 Add support for overriding the `!help` command strings
Log1x Feb 8, 2025
839f098
🧑‍💻 Create a `Hook` enum for hooks
Log1x Feb 8, 2025
b0e76a1
💄 Do not render the console prompt on Windows
Log1x Feb 8, 2025
ed16620
🚚 Move the `Hook` enum to the `Bot` namespace
Log1x Feb 8, 2025
67f16c4
🧑‍💻 Sprinkle some potentially useful hooks throughout the framework
Log1x Feb 8, 2025
f54305d
🧑‍💻 Add signal handlers for bot shutdown
Log1x Feb 8, 2025
8d5cc2a
🔥 Remove unnecessary configs
Log1x Feb 8, 2025
1b31e82
🩹 Fix service booting
Log1x Feb 8, 2025
09e2ae9
⏪ Restore the sessions config
Log1x Feb 8, 2025
71e8ae9
🎨 Simplify the logging handler for all environments
Log1x Feb 8, 2025
d8bc424
🔧 Increase flush interval
Log1x Feb 8, 2025
f2fe8b0
🧑‍💻 Improve service implementation
Log1x Feb 8, 2025
af33a07
🧑‍💻 Stop services when restarting
Log1x Feb 8, 2025
252f138
🎨 Use the bot instance for logging
Log1x Feb 8, 2025
4096172
🎨 Remove the console deconstructor
Log1x Feb 8, 2025
38b4e22
🚚 Move the `HasAsync` trait
Log1x Feb 8, 2025
47129ed
🎨 Make `callHook` public
Log1x Feb 8, 2025
c797c56
🔧 Move default log path to `.laracord/logs`
Log1x Feb 8, 2025
69e5f1c
🎨 Add the `HasAsync` trait to the Laracord instance
Log1x Feb 8, 2025
0ea241d
🎨 Remove unnecessary log rotate call
Log1x Feb 8, 2025
e044ef0
💄 Use box table style
Log1x Feb 8, 2025
9dba2ae
➕ Add `sebastian/environment` to the project
Log1x Feb 9, 2025
1afb773
➕ Add `sebastian/environment` to the project
Log1x Feb 9, 2025
952c732
✨ Add support for upcoming Discord Components v2
Log1x Feb 21, 2025
74111ae
🎨 Improve v2 components
Log1x Feb 21, 2025
6d6a2ae
🚨 Run Pint
Log1x Feb 21, 2025
8190cde
🩹 Fix middleware merging
Log1x Feb 21, 2025
c29f7e9
🎨 Improve v2 components
Log1x Feb 21, 2025
47014c8
🩹 Fix booting without a STDIN tty available (#136)
mikield Feb 22, 2025
5b3cc7f
🩹 Fix silencing debug on production
Log1x Feb 25, 2025
76b5898
🩹 Dont run command when prefix is followed by a space
Log1x Feb 26, 2025
9d5a629
🩹 Run eager services at a future tick
Log1x Feb 26, 2025
9a36fc3
💄 Add pagination to the default `!help` command
Log1x Feb 28, 2025
a0a16e0
🛂 Add initial auth support
Log1x Feb 28, 2025
0c47c63
🔧 Disable direct message commands by default
Log1x Mar 1, 2025
797cd25
➕ Add `illuminate/auth` to the project
Log1x Mar 2, 2025
30622b5
✨ Add package discovery
Log1x Mar 4, 2025
cd5e3f0
🎨 Use proper return type
Log1x Mar 21, 2025
61f54a3
🧑‍💻 Add configurable `defaults` to `Message::select`
Log1x Mar 23, 2025
5cf31dc
🧑‍💻 Add configurable `defaults` to `Message::select`
Log1x Mar 23, 2025
a1f670e
🎨 consistency
Log1x Mar 23, 2025
f0e4b5b
🎨 Improve select default value handling
Log1x Mar 23, 2025
f3e7a3e
🎨 Allow passing `defaults` for string select menus
Log1x Mar 23, 2025
42b670e
🎨 Tidy up select default handling
Log1x Mar 23, 2025
4522097
🔧 Add configuration for the logging handler
Log1x Mar 24, 2025
852e4a6
➕ Add `react/filesystem` to the project
Log1x Mar 24, 2025
715aad1
⚡ Utilize `react/filesystem` for handling file logging
Log1x Mar 24, 2025
298202d
🧑‍💻 Use the Message builder instance from the container
Log1x Mar 24, 2025
e2317e0
🎨 Clone the message instances
Log1x Mar 24, 2025
a1648dd
🎨 Improve return type
Log1x Mar 24, 2025
ee1bc16
🎨 Improve log rotation
Log1x Mar 24, 2025
d694965
🎨 Improve variable name
Log1x Mar 24, 2025
67ee032
🧑‍💻 Gracefully handle stale packages in the manifest
Log1x Mar 25, 2025
024570b
🎨 Add type to `Context::getUser`
Log1x May 17, 2025
308a076
🎨 Disable the HTTP server when not on shard 0
Log1x May 17, 2025
a5407c2
🩹 Fix the help command when it is not paged
Log1x May 17, 2025
0f8b1b1
🩹 Fix the help command when it is not paged
Log1x May 17, 2025
c08bab6
⬆️ Upgrade to Laravel v12
Log1x Jun 17, 2025
f8241c9
🔧 Add the `ContextServiceProvider` provider
Log1x Jun 17, 2025
9c77882
🎨 Do not needlessly cache registered options on slash command instances
Log1x Jun 17, 2025
912d829
✨ Add initial support for static files to the HTTP server
Log1x Jun 17, 2025
9d6fca3
⚡ Use ReactPHP Filesystem for static file handling
Log1x Jun 17, 2025
f61a7ec
🧑‍💻 Rename `Services` to `Tasks`
Log1x Jun 17, 2025
e79ea4e
✨ Create an initial `laracord:upgrade` command to assist in upgrading…
Log1x Jun 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 18 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,30 @@
"require": {
"php": "^8.2",
"guzzlehttp/guzzle": "^7.5",
"illuminate/cookie": "^11.0",
"illuminate/database": "^11.0",
"illuminate/encryption": "^11.0",
"illuminate/hashing": "^11.0",
"illuminate/http": "^11.0",
"illuminate/queue": "^11.0",
"illuminate/routing": "^11.0",
"illuminate/session": "^11.0",
"illuminate/translation": "^11.0",
"illuminate/validation": "^11.0",
"illuminate/view": "^11.0",
"illuminate/auth": "^12.0",
"illuminate/cookie": "^12.0",
"illuminate/database": "^12.0",
"illuminate/encryption": "^12.0",
"illuminate/hashing": "^12.0",
"illuminate/http": "^12.0",
"illuminate/log": "^12.0",
"illuminate/mail": "^12.0",
"illuminate/queue": "^12.0",
"illuminate/routing": "^12.0",
"illuminate/session": "^12.0",
"illuminate/translation": "^12.0",
"illuminate/validation": "^12.0",
"illuminate/view": "^12.0",
"intonate/tinker-zero": "^1.2",
"laravel-zero/framework": "^11.0",
"laravel-zero/framework": "^12.0",
"laravel/sanctum": "^4.0",
"react/async": "^4.2",
"react/filesystem": "0.2.x-dev",
"react/http": "^1.9",
"react/promise": "^3.0",
"sebastian/environment": "*",
"symfony/psr-http-message-bridge": "^7.0",
"team-reflex/discord-php": "^10.1"
"team-reflex/discord-php": "^10.3"
},
"require-dev": {
"laravel/pint": "^1.15"
Expand Down
76 changes: 2 additions & 74 deletions config/discord.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,6 @@

return [

/*
|--------------------------------------------------------------------------
| Discord Bot Description
|--------------------------------------------------------------------------
|
| Here you may specify the description of your Discord bot. This will be
| used when the bot is mentioned in chat, or when you run the "servers"
| command. Change this to anything you like.
|
*/

'description' => env('DISCORD_BOT_DESCRIPTION', 'The Laracord Discord Bot.'),

/*
|--------------------------------------------------------------------------
| Discord Token
Expand Down Expand Up @@ -74,6 +61,8 @@

'options' => [
'loadAllMembers' => true,
'storeMessages' => false,
'retrieveBans' => false,
],

/*
Expand Down Expand Up @@ -121,65 +110,4 @@
//
],

/*
|--------------------------------------------------------------------------
| Additional Commands
|--------------------------------------------------------------------------
|
| Here you may specify any additional commands for the Discord bot. These
| commands will be loaded in addition to the commands automatically loaded
| in your project. By default, the Laracord-provided help command is
| is registered here.
|
*/

'commands' => [
Laracord\Commands\HelpCommand::class,
],

/*
|--------------------------------------------------------------------------
| Additional Context Menus
|--------------------------------------------------------------------------
|
| Here you may specify any additional context menus for the Discord bot.
| These context menus will be loaded in addition to the context menus
| automatically loaded in your project.
|
*/

'menus' => [
//
],

/*
|--------------------------------------------------------------------------
| Additional Services
|--------------------------------------------------------------------------
|
| Here you may specify any additional services to run asynchronously
| alongside the Discord bot. These services will be loaded in addition
| to the services automatically loaded from your project.
|
*/

'services' => [
//
],

/*
|--------------------------------------------------------------------------
| Additional Events
|--------------------------------------------------------------------------
|
| Here you may specify any additional events to listen for in your
| Discord bot. These events will be registered in addition to the
| events automatically registered from your project.
|
*/

'events' => [
//
],

];
2 changes: 1 addition & 1 deletion config/filesystems.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

'local' => [
'driver' => 'local',
'root' => env('STORAGE_PATH', laracord_path('storage', basePath: false)),
'root' => storage_path(),
'throw' => false,
],

Expand Down
144 changes: 144 additions & 0 deletions config/logging.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
<?php

use Monolog\Handler\NullHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler;
use Monolog\Processor\PsrLogMessageProcessor;

return [

/*
|--------------------------------------------------------------------------
| Default Log Channel
|--------------------------------------------------------------------------
|
| This option defines the default log channel that is utilized to write
| messages to your logs. The value provided here should match one of
| the channels present in the list of "channels" configured below.
|
*/

'default' => env('LOG_CHANNEL', 'stack'),

/*
|--------------------------------------------------------------------------
| Deprecations Log Channel
|--------------------------------------------------------------------------
|
| This option controls the log channel that should be used to log warnings
| regarding deprecated PHP and library features. This allows you to get
| your application ready for upcoming major versions of dependencies.
|
*/

'deprecations' => [
'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
'trace' => env('LOG_DEPRECATIONS_TRACE', false),
],

/*
|--------------------------------------------------------------------------
| Log Channels
|--------------------------------------------------------------------------
|
| Here you may configure the log channels for your application. Laravel
| utilizes the Monolog PHP logging library, which includes a variety
| of powerful log handlers and formatters that you're free to use.
|
| Available drivers: "single", "daily", "slack", "syslog",
| "errorlog", "monolog", "custom", "stack"
|
*/

'channels' => [

'stack' => [
'driver' => 'stack',
'channels' => explode(',', env('LOG_STACK', 'laracord')),
'ignore_exceptions' => false,
],

'laracord' => [
'driver' => 'monolog',
'handler' => Laracord\Logging\LoggingHandler::class,
'with' => [
'path' => env('LOG_PATH', laracord_path('logs/laracord.log')),
'level' => env('LOG_LEVEL', 'debug'),
'maxSize' => env('LOG_MAX_SIZE', 10),
'maxFiles' => env('LOG_MAX_FILES', 5),
'flushInterval' => env('LOG_FLUSH_INTERVAL', 30),
],
],

'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'replace_placeholders' => true,
],

'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'days' => env('LOG_DAILY_DAYS', 14),
'replace_placeholders' => true,
],

'slack' => [
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => env('LOG_SLACK_USERNAME', 'Laravel Log'),
'emoji' => env('LOG_SLACK_EMOJI', ':boom:'),
'level' => env('LOG_LEVEL', 'critical'),
'replace_placeholders' => true,
],

'papertrail' => [
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
'handler_with' => [
'host' => env('PAPERTRAIL_URL'),
'port' => env('PAPERTRAIL_PORT'),
'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
],
'processors' => [PsrLogMessageProcessor::class],
],

'stderr' => [
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => StreamHandler::class,
'formatter' => env('LOG_STDERR_FORMATTER'),
'with' => [
'stream' => 'php://stderr',
],
'processors' => [PsrLogMessageProcessor::class],
],

'syslog' => [
'driver' => 'syslog',
'level' => env('LOG_LEVEL', 'debug'),
'facility' => env('LOG_SYSLOG_FACILITY', LOG_USER),
'replace_placeholders' => true,
],

'errorlog' => [
'driver' => 'errorlog',
'level' => env('LOG_LEVEL', 'debug'),
'replace_placeholders' => true,
],

'null' => [
'driver' => 'monolog',
'handler' => NullHandler::class,
],

'emergency' => [
'path' => storage_path('logs/laracord.log'),
],

],

];
2 changes: 1 addition & 1 deletion config/session.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
|
*/

'driver' => env('SESSION_DRIVER', 'file'),
'driver' => env('SESSION_DRIVER', 'cookie'),

/*
|--------------------------------------------------------------------------
Expand Down
Loading