Skip to content

Commit

Permalink
Add LOG_ALL_MESSAGE_CHANNEL for troubleshooting failures to trigger i…
Browse files Browse the repository at this point in the history
…n a collaborating server
  • Loading branch information
kevinlul committed Apr 30, 2024
1 parent 3169c02 commit 7ca3a59
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ jobs:
FTP_URL: ${{ secrets.FTP_URL }}
HEALTHCHECK_BOT_SNOWFLAKE: "1031374366426009753" # Singing Lanius#9842
DISCORD_TOTAL_SHARDS: 1
LOG_ALL_MESSAGE_CHANNEL: ${{ secrets.LOG_ALL_MESSAGE_CHANNEL }}
run: |
docker kill --signal=SIGTTIN $(docker ps --filter label=com.docker.swarm.service.name=discord-bot_bot --quiet) || echo No existing container!
docker stack deploy discord-bot -c <(docker-compose -f docker-staging.yaml config) --prune --with-registry-auth
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
BOT_PRESENCE: ${{ github.event.inputs.presence }}
BOT_MOTD: ${{ github.event.inputs.motd }}
BOT_BIND_MOUNT: ${{ secrets.PRODUCTION_BIND_MOUNT }}
LOG_ALL_MESSAGE_CHANNEL: ${{ secrets.LOG_ALL_MESSAGE_CHANNEL }}
run: |
docker-compose pull
docker-compose up -d
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ services:
BOT_LOGGER_WEBHOOK: "${BOT_LOGGER_WEBHOOK:-}"
BOT_PRESENCE: "${BOT_PRESENCE:-}"
BOT_MOTD: "${BOT_MOTD:-}"
LOG_ALL_MESSAGE_CHANNEL:
volumes:
- ${BOT_BIND_MOUNT}:/var/local/bastion
command: /var/local/bastion
Expand Down
1 change: 1 addition & 0 deletions docker-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ services:
BOT_PRESENCE: "${BOT_PRESENCE:-}"
BOT_MOTD: "${BOT_MOTD:-}"
BOT_NO_DIRECT_MESSAGE_SEARCH: 1
LOG_ALL_MESSAGE_CHANNEL:
logging:
driver: journald
deploy:
Expand Down
8 changes: 8 additions & 0 deletions src/events/message-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,14 @@ export class SearchMessageListener implements Listener<"messageCreate"> {
}

async run(message: Message): Promise<void> {
if (message.channelId === process.env.LOG_ALL_MESSAGE_CHANNEL) {
this.#logger.verbose(
JSON.stringify({
...(message.toJSON() as object),
channel: message.channel.toJSON()
})
);
}
if (shouldIgnore(message)) {
return;
}
Expand Down

0 comments on commit 7ca3a59

Please sign in to comment.