Tincho
Tincho
DIAdiscord.js - Imagine an app
Created by Tincho on 3/18/2024 in #djs-questions
setNickName limitations
In short: Discord is not made to display information in (near) real time
19 replies
DIAdiscord.js - Imagine an app
Created by Tincho on 3/18/2024 in #djs-questions
setNickName limitations
Roger that
19 replies
DIAdiscord.js - Imagine an app
Created by Tincho on 3/18/2024 in #djs-questions
setNickName limitations
Wouldn't sending 1 message every 2 or 3 seconds also be spam? 🤔
19 replies
DIAdiscord.js - Imagine an app
Created by Tincho on 3/18/2024 in #djs-questions
setNickName limitations
Maybe I'm abusing your cordiality and your time, but do you have any idea how to display information near real time on Discord?
19 replies
DIAdiscord.js - Imagine an app
Created by Tincho on 3/18/2024 in #djs-questions
setNickName limitations
Mmmmmmmmm..... I see
19 replies
DIAdiscord.js - Imagine an app
Created by Tincho on 3/18/2024 in #djs-questions
setNickName limitations
No description
19 replies
DIAdiscord.js - Imagine an app
Created by Tincho on 3/18/2024 in #djs-questions
setNickName limitations
Currently my bot offers the bitcoin price near in real time
19 replies
DIAdiscord.js - Imagine an app
Created by Tincho on 3/18/2024 in #djs-questions
setNickName limitations
Thank you for your feedback! Do you have any recommendations for making a ticker style bot?
19 replies
DIAdiscord.js - Imagine an app
Created by Tincho on 3/18/2024 in #djs-questions
setNickName limitations
And
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMessageReactions,
GatewayIntentBits.MessageContent,
],
rest: {
rejectOnRateLimit: (rateLimitData) => {
// Handle rate limit on setNickName
return rateLimitData.route === "/guilds/:id/members/@me";
},
},
});
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMessageReactions,
GatewayIntentBits.MessageContent,
],
rest: {
rejectOnRateLimit: (rateLimitData) => {
// Handle rate limit on setNickName
return rateLimitData.route === "/guilds/:id/members/@me";
},
},
});
19 replies
DIAdiscord.js - Imagine an app
Created by Tincho on 3/18/2024 in #djs-questions
setNickName limitations
Where
const trackLimits = new Collection<string, number>();
const trackLimits = new Collection<string, number>();
19 replies
DIAdiscord.js - Imagine an app
Created by Tincho on 3/18/2024 in #djs-questions
setNickName limitations
Hello, this is the solution I found so that the bot can change its nickname freely and manage the API limits:
client.guilds.cache.forEach((guild) => {
if (nickname != guild.members.me?.nickname) {
if (trackLimits.has(guild.id)) {
if (trackLimits.get(guild.id)! < new Date().getTime()) {
debug("Resetting limit");
trackLimits.delete(guild.id);
} else {
return;
}
}

guild.members.me?.setNickname(nickname).catch((err) => {
if (err instanceof RateLimitError) {
error(
"LIMIT on guild %s - Waiting for %d",
guild.id,
err.timeToReset
);
trackLimits.set(guild.id, err.timeToReset + new Date().getTime());
} else {
error("Error in setNickname: %o", err);
}
});
}
});
client.guilds.cache.forEach((guild) => {
if (nickname != guild.members.me?.nickname) {
if (trackLimits.has(guild.id)) {
if (trackLimits.get(guild.id)! < new Date().getTime()) {
debug("Resetting limit");
trackLimits.delete(guild.id);
} else {
return;
}
}

guild.members.me?.setNickname(nickname).catch((err) => {
if (err instanceof RateLimitError) {
error(
"LIMIT on guild %s - Waiting for %d",
guild.id,
err.timeToReset
);
trackLimits.set(guild.id, err.timeToReset + new Date().getTime());
} else {
error("Error in setNickname: %o", err);
}
});
}
});
19 replies
DIAdiscord.js - Imagine an app
Created by Tincho on 3/18/2024 in #djs-questions
setNickName limitations
Thank you so much! I'll look at this and come back for more help 😁
19 replies
DIAdiscord.js - Imagine an app
Created by Tincho on 3/18/2024 in #djs-questions
setNickName limitations
I understand that it is being filtered by Spam, and my intention is to lower the frequency... the problem is that no one tells me what the limitation is 😕
19 replies
DIAdiscord.js - Imagine an app
Created by Tincho on 3/18/2024 in #djs-questions
setNickName limitations
Hahaha
19 replies
DIAdiscord.js - Imagine an app
Created by Tincho on 3/18/2024 in #djs-questions
setNickName limitations
discord.js 14.13.0
node v18.18.0
discord.js 14.13.0
node v18.18.0
19 replies
DIAdiscord.js - Imagine an app
Created by Tincho on 7/27/2023 in #djs-questions
Send lightning network lnurlp link
Webhock maybe? I didn't used them
13 replies
DIAdiscord.js - Imagine an app
Created by Tincho on 7/27/2023 in #djs-questions
Send lightning network lnurlp link
Ok, embed discarded 😫
13 replies
DIAdiscord.js - Imagine an app
Created by Tincho on 7/27/2023 in #djs-questions
Send lightning network lnurlp link
13 replies
DIAdiscord.js - Imagine an app
Created by Tincho on 7/27/2023 in #djs-questions
Send lightning network lnurlp link
So.... any idea? 😂
13 replies
DIAdiscord.js - Imagine an app
Created by Tincho on 7/27/2023 in #djs-questions
Send lightning network lnurlp link
This try was in setURL() from EmbedBuilder
13 replies