🆙 More fixes 🆙

This commit is contained in:
Remco
2026-01-19 17:32:44 +01:00
parent 3f9e928952
commit 521f9c884c
6 changed files with 46 additions and 30 deletions
@@ -67,6 +67,7 @@ class CreateNewUser implements CreatesNewUsers
'ip_current' => $ip,
'auth_ticket' => '',
'home_room' => (int) (setting('hotel_home_room') ?: 0),
'referral_code' => '',
]);
$user->update([
@@ -134,17 +135,20 @@ class CreateNewUser implements CreatesNewUsers
private function sendDiscordWebhook(string $username, string $ip, string $email): void
{
if (setting('discord_webhook_url') === '') {
Log::error('Discord webhook url not provided', ['Please provide a discord webhook url before being able to send any webhook requests.']);
Log::error('Discord webhook url not provided', [
'message' => 'Please provide a discord webhook url before being able to send any webhook requests.',
]);
return;
}
$request = Http::asJson()->post(setting('discord_webhook_url'), [
'username' => sprintf('%s Bot', setting('hotel_name')),
'content' => "User: {$username} has just registered, with the IP: {$ip} and E-mail: {$email}",
]);
$request = Http::asJson()->post(
url: setting('discord_webhook_url'),
data: [
'username' => sprintf('%s Bot', setting('hotel_name')),
'content' => "User: {$username} has just registered, with the IP: {$ip} and E-mail: {$email}",
]
);
// Log the error in-case webhook wasn't sent
if (! $request->successful()) {
Log::error('Failed to send Discord webhook notification', [
'username' => $username,