Skip to content

Commit

Permalink
fix(levels): correctly query for level
Browse files Browse the repository at this point in the history
  • Loading branch information
ScuffedNewt committed Aug 16, 2024
1 parent f4a0f99 commit 633c800
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/Console/Commands/DiscordBot.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ function ($e) use ($command) {
$promises = [];

// check if there are any level roles they need applied
$userLevel = $user->discordLevel?->level;
$userLevel = $user->discord?->level;
if ($userLevel) {
$levelRoles = DiscordReward::where('level', '<=', $userLevel)->whereNotNull('role_reward_id')->get();
foreach ($levelRoles as $levelRole) {
Expand Down
2 changes: 1 addition & 1 deletion app/Models/User/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public function bookmarks() {
* Get the user's current discord chat level.
*/
public function discord() {
return $this->belongsTo('App\Models\User\UserDiscordLevel', 'user_id');
return $this->belongsTo(UserDiscordLevel::class, 'user_id');
}

/**
Expand Down

0 comments on commit 633c800

Please sign in to comment.