Skip to content

Commit

Permalink
Added user spammer flag
Browse files Browse the repository at this point in the history
Signed-off-by: Felix <github@fbrettnich.de>
  • Loading branch information
fbrettnich committed Apr 29, 2024
1 parent 307f5c6 commit f3d6cc0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/Helpers/Discord.php
Expand Up @@ -752,6 +752,9 @@ function getUser($userId)
$array['flagsList'] = getUserFlagList($array['flags']);
if ($array['flags'] & (1 << 16))
$array['isVerifiedBot'] = true;

if ($array['flags'] & (1 << 20))
$array['isSpammer'] = true;
}

if (key_exists('premium_type', $responseJson) && $responseJson['premium_type'] != null) {
Expand Down Expand Up @@ -965,6 +968,8 @@ function parseInviteJson($json)
'flagsList' => [],
'isBot' => false,
'isVerifiedBot' => false,
'isSpammer' => false,
'clan' => [],
],
'channel' => [
'id' => '',
Expand Down Expand Up @@ -1138,7 +1143,13 @@ function parseInviteJson($json)
$array['inviter']['flagsList'] = getUserFlagList($array['inviter']['flags']);
if ($array['inviter']['flags'] & (1 << 16))
$array['inviter']['isVerifiedBot'] = true;

if ($array['inviter']['flags'] & (1 << 20))
$array['inviter']['isSpammer'] = true;
}

if (key_exists('clan', $json['inviter']) && $json['inviter']['clan'] != null)
$array['inviter']['clan'] = $json['inviter']['clan'];
}

if(array_key_exists('expires_at', $json) && $json['expires_at'] != null)
Expand Down
11 changes: 11 additions & 0 deletions resources/views/components/user-card.blade.php
Expand Up @@ -96,6 +96,17 @@
</div>
@endif

<div class="grid grid-cols-1 md:grid-cols-2">
<span class="font-semibold">{{ __('Spammer') }}<span class="hidden md:inline">:</span></span>
<p class="my-auto">
@if($user['isSpammer'])
<img src="{{ asset('images/discord/icons/check.svg') }}" class="h-4 w-4" alt="Check" />
@else
<img src="{{ asset('images/discord/icons/cross.svg') }}" class="h-4 w-4" alt="Cross" />
@endif
</p>
</div>

@if($user['bannerColor'])
<div class="grid grid-cols-1 md:grid-cols-2">
<span class="font-semibold">{{ __('Banner Color') }}<span class="hidden md:inline">:</span></span>
Expand Down

0 comments on commit f3d6cc0

Please sign in to comment.