feat: public bot warnings

This commit is contained in:
Isaac 2023-03-10 23:47:12 +00:00
parent 26329453ed
commit cd71843bb0
No known key found for this signature in database
GPG Key ID: 0DE40AE37BBA5C33

View File

@ -34,6 +34,12 @@ module.exports = class extends Listener {
.catch(client.log.error); .catch(client.log.error);
} }
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) {
client.log.warn('Your bot is public, but public features are disabled. Set the `PUBLIC_BOT` environment variable to `true`, or make your bot private.');
}
// commands are not cached automatically // commands are not cached automatically
await client.application.commands.fetch(); await client.application.commands.fetch();