Skip to content

Commit

Permalink
feat(api): public bot warning
Browse files Browse the repository at this point in the history
  • Loading branch information
eartharoid committed Jan 31, 2025
1 parent 55660e8 commit 96cc84e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/listeners/client/ready.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ module.exports = class extends Listener {
.catch(client.log.error);
}

await client.application.fetch();
if (process.env.PUBLIC_BOT === 'true' && !client.application.botPublic) {
client.log.warn('The `PUBLIC_BOT` environment variable is set to `true`, but the bot is not public.');
} else if (process.env.PUBLIC_BOT === 'false' && client.application.botPublic) {
Expand Down
4 changes: 4 additions & 0 deletions src/routes/api/admin/guilds/[guild]/problems.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ module.exports.get = fastify => ({
permission: 'EmbedLinks',
});
}

if (process.env.PUBLIC_BOT === 'false' && client.application.botPublic) {
problems.push({ id: 'botPublic' });
}
}

return problems;
Expand Down

0 comments on commit 96cc84e

Please sign in to comment.