mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2025-09-02 16:41:25 +03:00
feat: add PUBLISH_COMMANDS
environment variable
This commit is contained in:
@@ -35,6 +35,7 @@ const env = {
|
||||
HTTP_TRUST_PROXY: () => true, // optional
|
||||
OVERRIDE_ARCHIVE: () => true, // optional
|
||||
PUBLIC_BOT: () => true, // optional
|
||||
PUBLISH_COMMANDS: () => true, // optional
|
||||
SETTINGS_HOST: v =>
|
||||
(!!v && !v.startsWith('http')) ||
|
||||
new Error('is required and must be an address, not a URL'),
|
||||
|
@@ -23,8 +23,16 @@ module.exports = class extends Listener {
|
||||
process.title = 'tickets';
|
||||
client.log.success('Connected to Discord as "%s"', client.user.tag);
|
||||
|
||||
// fill cache
|
||||
await sync(client);
|
||||
|
||||
if (process.env.PUBLISH_COMMANDS === 'true') {
|
||||
client.log.info('Automatically publishing commands...');
|
||||
client.commands.publish()
|
||||
.then(commands => client.log.success('Published %d commands', commands?.size))
|
||||
.catch(client.log.error);
|
||||
}
|
||||
|
||||
// presence/activity
|
||||
let next = 0;
|
||||
const setPresence = async () => {
|
||||
|
Reference in New Issue
Block a user