You've already forked Epicnabbo-Catalogus-Updated-Daily
🆙 More fixes 🆙
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user