IAmBatman
IAmBatman
DIAdiscord.js - Imagine an app
Created by IAmBatman on 10/1/2024 in #djs-questions
How to mention a guild
Okay, thanks for the fast reply
4 replies
DIAdiscord.js - Imagine an app
Created by Tyranasaurus on 5/3/2024 in #djs-questions
'Unknown Integration'
I sometimes get this when I try to send or reply with a string that has only timestamps, role/user mentions. Adding some other text to the the string solves the issue
6 replies
DIAdiscord.js - Imagine an app
Created by IAmBatman on 5/1/2024 in #djs-questions
Relative timestamp in embed footer
Okay, that's what I was wondering. Thank you!
7 replies
DIAdiscord.js - Imagine an app
Created by IAmBatman on 5/1/2024 in #djs-questions
Relative timestamp in embed footer
setTimestamp displays the current time yes, but it doesn't display a dynamic timestamp, a relative timestamp does that.
7 replies
DIAdiscord.js - Imagine an app
Created by IAmBatman on 4/13/2024 in #djs-questions
Cannot register commands globally
Okay, that’s good to know. Thank you both for all the help
9 replies
DIAdiscord.js - Imagine an app
Created by IAmBatman on 4/13/2024 in #djs-questions
Cannot register commands globally
Ah that's probably the issue, you are right. I wasn't aware of this limit. One question tho. Does refreshing an already existing command count towards this limit, or do only newly registered commands count? If everything counts, I guess I need check if a command already exists in the application commands, then register if it doesn't. Right?
9 replies
DIAdiscord.js - Imagine an app
Created by IAmBatman on 4/13/2024 in #djs-questions
Cannot register commands globally
The code that works:
try {

console.log(
`🔄 Started refreshing ${commands.length} application commands...`
);

const data = await rest.put(
Routes.applicationGuildCommands(
process.env.CLIENT_ID,
process.env.GUILD_ID
),
{
body: commands,
}
);

console.log(`✅ Successfully refreshed ${data.length} application commands!`);
} catch (err) {
console.log(`There was an error: ${err}`);
}
try {

console.log(
`🔄 Started refreshing ${commands.length} application commands...`
);

const data = await rest.put(
Routes.applicationGuildCommands(
process.env.CLIENT_ID,
process.env.GUILD_ID
),
{
body: commands,
}
);

console.log(`✅ Successfully refreshed ${data.length} application commands!`);
} catch (err) {
console.log(`There was an error: ${err}`);
}
The code that doesn't work:
try {
console.log(
`🔄 Started refreshing ${commands.length} application commands...`
);

const data = await rest.put(
Routes.applicationCommands(process.env.CLIENT_ID),
{
body: commands,
}
);

console.log(`✅ Successfully refreshed ${data.length} application commands!`);
} catch (err) {
console.log(`There was an error: ${err}`);
}
try {
console.log(
`🔄 Started refreshing ${commands.length} application commands...`
);

const data = await rest.put(
Routes.applicationCommands(process.env.CLIENT_ID),
{
body: commands,
}
);

console.log(`✅ Successfully refreshed ${data.length} application commands!`);
} catch (err) {
console.log(`There was an error: ${err}`);
}
and on which line does it hang? is it that you've confirmed it hangs because Successfully refreshed ${data.length} application commands! doesn't log?
Yes, it hangs right where I wait for rest.put(Routes.applicationGuildCommands(...))
9 replies
DIAdiscord.js - Imagine an app
Created by IAmBatman on 4/13/2024 in #djs-questions
Cannot register commands globally
The reason I am deploying an empty array was because I had duplicates of every command previously, so I wanted to clear everything in every guild before deploying. Maybe clearing global application commands is not needed though.
that sounds like a rate limit, which given the fact that you're making several unnecessary api calls prior to your commented code, this seems probable
Even when I delete the unnecessary api calls, Routes.applicationCommands() still doesn't work. Routes.applicationGuildCommands() (which I am using for a single guild) works with or without the unnecessary api calls. Not sure if the problem is rate limit
9 replies