Skip to content

Commit

Permalink
Update Apod.php
Browse files Browse the repository at this point in the history
  • Loading branch information
bariscodefxy authored Jul 30, 2023
1 parent 8dadd64 commit 1ffe555
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/commands/utility/Apod.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ public function configure(): void
*/
public function handle($msg, $args): void
{
$this->browser->get("https://api.nasa.gov/planetary/apod?thumbs=true&api_key=cAHfqwYbmsLQBpLcIbpLYzXn7q9ArLgrPr6BGVss")->then(function (ResponseInterface $response) use ($msg) {
$this->browser->get("https://api.nasa.gov/planetary/apod?thumbs=true&api_key=" . $_ENV['nasa_key'])->then(function (ResponseInterface $response) use ($msg) {
$embed = new Embed($this->discord);

$result = json_decode((string)$response->getBody());

$embed->setAuthor(null, $msg->author->avatar);
$embed->setAuthor($result->copyright, $msg->author->avatar);
$embed->setTitle($result->title);
$embed->setImage($result->hdurl);
$embed->setDescription($result->explanation);
Expand Down

0 comments on commit 1ffe555

Please sign in to comment.