ChainsawXIV
ChainsawXIV
DIdiscord.js - Imagine ❄
Created by ChainsawXIV on 1/16/2025 in #djs-questions
messageCreate isn't firing
For posterity and anyone coming along later with this problem, we needed to go into the bot's setup on https://discord.com/developers/applications, to the Installation section, add bot to the Guild Install Scopes then add the appropriate permissions from the dropdown, then re-add the bot to the server and approve all its new perms. It was non-obvious that adding bot would expand into a bunch more options, and we thought we had everything we needed with our other perms.
25 replies
DIdiscord.js - Imagine ❄
Created by ChainsawXIV on 1/16/2025 in #djs-questions
messageCreate isn't firing
Thanks much - this was in fact the issue, and easily fixed with your guidance. 🙂 Much appreciated to all who helped! ♥️
25 replies
DIdiscord.js - Imagine ❄
Created by ChainsawXIV on 1/16/2025 in #djs-questions
messageCreate isn't firing
That makes sense, thanks. Now I'm trying to figure out how to google that problem considering it contains almost no unique search terms 😄
25 replies
DIdiscord.js - Imagine ❄
Created by ChainsawXIV on 1/16/2025 in #djs-questions
messageCreate isn't firing
I... think that makes sense, but I'm not entirely sure I actually understand 😄 In fact, I'm fully sure I don't completely understand... Can you throw that at me in different words and/or speculate about how that happens and how to fix it? I have verified that the /commands are in fact talking to this specific server and back by checking the server logs and changing the message sent back in response to a simple "ping" even to something unique.
25 replies
DIdiscord.js - Imagine ❄
Created by ChainsawXIV on 1/16/2025 in #djs-questions
messageCreate isn't firing
Yup:
// listen for the client to be ready
discord_client.once(Events.ClientReady, (c) => {
console.log(`Ready! Logged in as ${c.user.tag}`);
let count = discord_client.channels.cache.size;
let gcount = discord_client.guilds.cache.size;
console.log(`Channels: ${count}, Guilds: ${gcount}`);
if( count > 0 ){
let temp = discord_client.channels.cache.get("general");
console.log(`Can see #general: ${(temp as GuildChannel).viewable}`);
}
});
// listen for the client to be ready
discord_client.once(Events.ClientReady, (c) => {
console.log(`Ready! Logged in as ${c.user.tag}`);
let count = discord_client.channels.cache.size;
let gcount = discord_client.guilds.cache.size;
console.log(`Channels: ${count}, Guilds: ${gcount}`);
if( count > 0 ){
let temp = discord_client.channels.cache.get("general");
console.log(`Can see #general: ${(temp as GuildChannel).viewable}`);
}
});
25 replies
DIdiscord.js - Imagine ❄
Created by ChainsawXIV on 1/16/2025 in #djs-questions
messageCreate isn't firing
(or there are zero in the cache at least - not sure if that means what I expect it to)
25 replies
DIdiscord.js - Imagine ❄
Created by ChainsawXIV on 1/16/2025 in #djs-questions
messageCreate isn't firing
Sure thing 🙂 It also reports being in 0 guilds.
25 replies
DIdiscord.js - Imagine ❄
Created by ChainsawXIV on 1/16/2025 in #djs-questions
messageCreate isn't firing
No description
25 replies
DIdiscord.js - Imagine ❄
Created by ChainsawXIV on 1/16/2025 in #djs-questions
messageCreate isn't firing
Looks like that narrows the problem... I added:
var count = discord_client.channels.cache.size;
console.log(`Channels: ${count}`);
if( count > 0 ){
var temp = discord_client.channels.cache.get("general").isSendable();
console.log(`Can send in #general: ${temp}`);
}
var count = discord_client.channels.cache.size;
console.log(`Channels: ${count}`);
if( count > 0 ){
var temp = discord_client.channels.cache.get("general").isSendable();
console.log(`Can send in #general: ${temp}`);
}
And it tells me the bot has 0 cached channels. Now the question is why... (Incidentally, viewable doesn't appear to be a property of channels.)
25 replies