Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
HazAT committed Nov 27, 2024
1 parent c2424e8 commit ceaa6df
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Event/AbstractEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

namespace App\Event;

use App\Http\SlackClient;
use App\Http\DiscordClient;
use App\Http\SlackClient;
use Cake\ORM\Locator\LocatorAwareTrait;

abstract class AbstractEvent
Expand Down
6 changes: 2 additions & 4 deletions src/Event/LinkSharedEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

namespace App\Event;

use RestCord\DiscordClient;

class LinkSharedEvent extends AbstractEvent
{
public string $user;
Expand Down Expand Up @@ -69,9 +67,9 @@ private function fetchDiscordMessage(string $url): string
$parts = explode('/', $url);
$channelId = $parts[5];
$messageId = $parts[6];

$message = $this->discordClient->getMessage($channelId, $messageId);

return $message;
}

}
3 changes: 2 additions & 1 deletion src/Http/DiscordClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct()

/**
* Get a message from a channel
*
*
* @param string $channelId The channel ID
* @param string $messageId The message ID
* @return string The message content
Expand All @@ -41,6 +41,7 @@ public function getMessage(string $channelId, string $messageId): string

if ($response->isSuccess()) {
$json = $response->getJson();

return $json['content'] ?? '';
}

Expand Down

0 comments on commit ceaa6df

Please sign in to comment.