Skip to content

Commit

Permalink
Update Command.php
Browse files Browse the repository at this point in the history
  • Loading branch information
key2peace authored Nov 12, 2022
1 parent 9ccab55 commit be6f7d8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Discord/Parts/Interactions/Command/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ public function getCreatableAttributes(): array
];

foreach($attributes as $attribute => $raw) {
if ($raw) {
$attr[$attribute] = $this->getAttribute($attribute);
if ($raw && $value = $this->getAttribute($attribute)) {
$attr[$attribute] = $value;
} elseif (array_key_exists($attribute, $this->attributes)) {
$attr[$attribute] = $this->attributes[$attribute];
}
Expand Down Expand Up @@ -167,8 +167,8 @@ public function getUpdatableAttributes(): array
];

foreach($attributes as $attribute => $raw) {
if ($raw) {
$attr[$attribute] = $this->getAttribute($attribute);
if ($raw && $value = $this->getAttribute($attribute)) {
$attr[$attribute] = $value;
} elseif (array_key_exists($attribute, $this->attributes)) {
$attr[$attribute] = $this->attributes[$attribute];
}
Expand Down

0 comments on commit be6f7d8

Please sign in to comment.