Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,4 @@ TWITCH_OAUTH_CLIENT_SECRET=
TWITCH_OAUTH_REDIRECT_URI=

DISCORD_TOKEN=
DISCORD_GENERAL_CHAT_ID=
5 changes: 5 additions & 0 deletions app-modules/bot-discord/src/Events/GreetingsEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ public function handle(Message $message, Discord $discord): void
return;
}

$allowedChannel = config('services.discord.general_chat_id');
if ($message->channel_id !== $allowedChannel) {
return;
}

$this->logger()->notice(sprintf('%s: %s', $message->author->username, $message->content));

$hour = now()->hour;
Expand Down
1 change: 1 addition & 0 deletions config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
'redirect_uri' => env('DISCORD_OAUTH_REDIRECT_URI', 'https://localhost:8000/auth/oauth/discord'),
'scopes' => env('DISCORD_OAUTH_SCOPES', 'identify email'),
'enabled' => env('DISCORD_OAUTH_ENABLED', true),
'general_chat_id' => env('DISCORD_GENERAL_CHAT_ID'),
],
'twitch' => [
'client_id' => env('TWITCH_OAUTH_CLIENT_ID'),
Expand Down