feat(api): public bot warning

This commit is contained in:
Isaac 2025-01-31 04:45:22 +00:00
parent 55660e8c4e
commit 96cc84e13c
No known key found for this signature in database
GPG Key ID: 0DE40AE37BBA5C33
2 changed files with 5 additions and 0 deletions

View File

@ -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) {

View File

@ -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;