Automating Daily Devlog Summaries with Discord Webhooks and Laravel
Keeping a team updated on daily development progress can be a chore. Manually sifting through commits, summarizing changes, and communicating them to the relevant stakeholders consumes valuable developer time and often leads to inconsistent updates. For our devlog-ist/landing project, we recently tackled this by implementing an automated system to generate and send daily changelog summaries directly to a Discord channel.
The Challenge of Manual Updates
Imagine a typical development day. Multiple developers push various changes—bug fixes, new features, refactors. At the end of the day, someone needs to aggregate these, translate them into a digestible format, and share them. This process is prone to:
- Inconsistency: Different people summarize differently.
- Time Consumption: It takes away from coding.
- Oversights: Important changes might be missed.
- Lag: Updates might not be timely, leading to information gaps.
Our goal was to eliminate this friction and ensure our team was always in sync without extra effort.
The Automated Solution: Laravel, AI, and Discord
We leveraged Laravel's robust scheduling capabilities, integrated an AI service for intelligent summarization, and utilized Discord webhooks for instant delivery. The system now automatically:
- Gathers Recent Commits: On a daily schedule, the application fetches commits since the last summary was sent.
- Generates AI Summaries: An AI model processes these commit messages to create a concise, human-readable summary, even translating them to Spanish as required for our team.
- Prevents Duplicates: It tracks which commits have already been summarized and sent, ensuring that the same information isn't posted repeatedly.
- Delivers to Discord: The AI-generated summary is then formatted and pushed to a designated Discord channel via a webhook.
This workflow ensures that our devlog-ist/landing project's daily progress is consistently communicated, freeing up developers to focus on building.
Implementation Snippets
At the heart of this system lies a scheduled Laravel command. Here's a simplified look at how you might set up a daily job to achieve this:
First, define a custom Artisan command:
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Http;
use App\Services\ChangelogService;
class SendDailyChangelogSummary extends Command
{
protected $signature = 'changelog:send-daily';
protected $description = 'Send daily AI-generated changelog summary to Discord.';
public function handle(ChangelogService $changelogService)
{
$this->info('Fetching daily commits...');
$newCommits = $changelogService->getNewCommits();
if ($newCommits->isEmpty()) {
$this->info('No new commits to summarize.');
return Command::SUCCESS;
}
$this->info('Generating AI summary...');
$summary = $changelogService->generateSummary($newCommits);
$this->info('Sending to Discord...');
Http::post(config('services.discord.webhook_url'), [
'content' => $summary,
'username' => 'DevLog Bot',
'avatar_url' => 'https://example.com/bot-avatar.png'
]);
$changelogService->markCommitsAsSent($newCommits);
$this->info('Daily changelog summary sent!');
return Command::SUCCESS;
}
}
Then, schedule this command to run daily in your App\Console\Kernel.php:
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
protected function schedule(Schedule $schedule)
{
$schedule->command('changelog:send-daily')->dailyAt('17:00'); // Every day at 5 PM
}
}
The ChangelogService would encapsulate the logic for fetching Git commits, interacting with an AI API, and managing the state of sent commits (e.g., storing commit hashes in a database).
This simple yet powerful automation dramatically improves team communication and transparency, making sure everyone is aware of the latest developments without any manual overhead.