mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-12-22 15:53:08 +02:00
feat: add PUBLISH_COMMANDS
environment variable
This commit is contained in:
parent
ff626d2871
commit
adab3831fa
@ -39,11 +39,12 @@ services:
|
|||||||
HTTP_HOST: 0.0.0.0
|
HTTP_HOST: 0.0.0.0
|
||||||
HTTP_PORT: 80
|
HTTP_PORT: 80
|
||||||
HTTP_TRUST_PROXY: false # set to true if you're using a reverse proxy
|
HTTP_TRUST_PROXY: false # set to true if you're using a reverse proxy
|
||||||
PUBLIC_BOT: false
|
|
||||||
OVERRIDE_ARCHIVE: null
|
OVERRIDE_ARCHIVE: null
|
||||||
|
PUBLIC_BOT: false
|
||||||
|
PUBLISH_COMMANDS: false
|
||||||
SETTINGS_PORT: 8169
|
SETTINGS_PORT: 8169
|
||||||
SETTINGS_HOST: 127.0.0.1
|
SETTINGS_HOST: 127.0.0.1
|
||||||
SUPER: !!str 319467558166069248 # optionally add `,youruseridhere`
|
SUPER: 319467558166069248 # optionally add `,youruseridhere`
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
discord-tickets:
|
discord-tickets:
|
||||||
|
@ -24,6 +24,7 @@ const env = {
|
|||||||
HTTP_TRUST_PROXY: false,
|
HTTP_TRUST_PROXY: false,
|
||||||
OVERRIDE_ARCHIVE: '',
|
OVERRIDE_ARCHIVE: '',
|
||||||
PUBLIC_BOT: false,
|
PUBLIC_BOT: false,
|
||||||
|
PUBLISH_COMMANDS: false,
|
||||||
SETTINGS_HOST: '127.0.0.1',
|
SETTINGS_HOST: '127.0.0.1',
|
||||||
SETTINGS_PORT: 8169,
|
SETTINGS_PORT: 8169,
|
||||||
SUPER: '319467558166069248',
|
SUPER: '319467558166069248',
|
||||||
|
@ -35,6 +35,7 @@ const env = {
|
|||||||
HTTP_TRUST_PROXY: () => true, // optional
|
HTTP_TRUST_PROXY: () => true, // optional
|
||||||
OVERRIDE_ARCHIVE: () => true, // optional
|
OVERRIDE_ARCHIVE: () => true, // optional
|
||||||
PUBLIC_BOT: () => true, // optional
|
PUBLIC_BOT: () => true, // optional
|
||||||
|
PUBLISH_COMMANDS: () => true, // optional
|
||||||
SETTINGS_HOST: v =>
|
SETTINGS_HOST: v =>
|
||||||
(!!v && !v.startsWith('http')) ||
|
(!!v && !v.startsWith('http')) ||
|
||||||
new Error('is required and must be an address, not a URL'),
|
new Error('is required and must be an address, not a URL'),
|
||||||
|
@ -23,8 +23,16 @@ module.exports = class extends Listener {
|
|||||||
process.title = 'tickets';
|
process.title = 'tickets';
|
||||||
client.log.success('Connected to Discord as "%s"', client.user.tag);
|
client.log.success('Connected to Discord as "%s"', client.user.tag);
|
||||||
|
|
||||||
|
// fill cache
|
||||||
await sync(client);
|
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
|
// presence/activity
|
||||||
let next = 0;
|
let next = 0;
|
||||||
const setPresence = async () => {
|
const setPresence = async () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user