ROB0520
ROB0520
DIAdiscord.js - Imagine an app
Created by ROB0520 on 8/3/2023 in #djs-questions
create-discord-bot issues
Ooh aight
30 replies
DIAdiscord.js - Imagine an app
Created by ROB0520 on 8/3/2023 in #djs-questions
create-discord-bot issues
thanks for helping me out btw! Ill just mark this post as solved once https://github.com/discordjs/discord.js/pull/9747 is merged already
30 replies
DIAdiscord.js - Imagine an app
Created by ROB0520 on 8/3/2023 in #djs-questions
create-discord-bot issues
ah alright then, I guess Im just gonna keep that in mind when making more bots with the template
30 replies
DIAdiscord.js - Imagine an app
Created by ROB0520 on 8/3/2023 in #djs-questions
create-discord-bot issues
neat that worked, thanks! could you also open a pr for that to get fixed too?
30 replies
DIAdiscord.js - Imagine an app
Created by ROB0520 on 8/3/2023 in #djs-questions
create-discord-bot issues
alr
30 replies
DIAdiscord.js - Imagine an app
Created by ROB0520 on 8/3/2023 in #djs-questions
create-discord-bot issues
or do I just copy from discordjs.guide in the meant time?
30 replies
DIAdiscord.js - Imagine an app
Created by ROB0520 on 8/3/2023 in #djs-questions
create-discord-bot issues
any ideas on how to fix it?
30 replies
DIAdiscord.js - Imagine an app
Created by ROB0520 on 8/3/2023 in #djs-questions
create-discord-bot issues
though is the API class a new thing? Ive never used it before nor have I heard of the bulkOverwriteGlobalCommands function
30 replies
DIAdiscord.js - Imagine an app
Created by ROB0520 on 8/3/2023 in #djs-questions
create-discord-bot issues
This is the entire file content, and I didnt change anything from the template when I did my "workaround"
import process from 'node:process';
import { URL } from 'node:url';
import { API } from '@discordjs/core/http-only';
import { REST } from 'discord.js';
import { loadCommands } from './loaders.js';

const commands = await loadCommands(new URL('commands/', import.meta.url));
const commandData = [...commands.values()].map((command) => command.data);

const rest = new REST({ version: '10' }).setToken(process.env.TOKEN!);
const api = new API(rest);

const result = await api.applicationCommands.bulkOverwriteGlobalCommands(process.env.APPLICATION_ID!, commandData);

console.log(`Successfully registered ${result.length} commands.`);
import process from 'node:process';
import { URL } from 'node:url';
import { API } from '@discordjs/core/http-only';
import { REST } from 'discord.js';
import { loadCommands } from './loaders.js';

const commands = await loadCommands(new URL('commands/', import.meta.url));
const commandData = [...commands.values()].map((command) => command.data);

const rest = new REST({ version: '10' }).setToken(process.env.TOKEN!);
const api = new API(rest);

const result = await api.applicationCommands.bulkOverwriteGlobalCommands(process.env.APPLICATION_ID!, commandData);

console.log(`Successfully registered ${result.length} commands.`);
30 replies
DIAdiscord.js - Imagine an app
Created by ROB0520 on 8/3/2023 in #djs-questions
create-discord-bot issues
no?
30 replies
DIAdiscord.js - Imagine an app
Created by ROB0520 on 8/3/2023 in #djs-questions
create-discord-bot issues
This is for the typescript template
30 replies
DIAdiscord.js - Imagine an app
Created by ROB0520 on 8/3/2023 in #djs-questions
create-discord-bot issues
30 replies
DIAdiscord.js - Imagine an app
Created by ROB0520 on 8/3/2023 in #djs-questions
create-discord-bot issues
yeah I noticed XD
30 replies
DIAdiscord.js - Imagine an app
Created by ROB0520 on 8/3/2023 in #djs-questions
create-discord-bot issues
welp aight then
30 replies
DIAdiscord.js - Imagine an app
Created by ROB0520 on 8/3/2023 in #djs-questions
create-discord-bot issues
could I like test it somehow?
30 replies
DIAdiscord.js - Imagine an app
Created by ROB0520 on 8/3/2023 in #djs-questions
create-discord-bot issues
how?
30 replies
DIAdiscord.js - Imagine an app
Created by ROB0520 on 8/3/2023 in #djs-questions
create-discord-bot issues
welp I found a "work around" for it which would be running the .mjs file after running the npx command. But Id like to know how to fix it cause it is annoying to do
30 replies