ManuelMaccou | Mosaic
Explore posts from serversDIAdiscord.js - Imagine a boo! 👻
•Created by ManuelMaccou | Mosaic on 8/1/2023 in #djs-questions
getting partials for reactions when only ID is guaranteed
got it. Can i also get the user that made the reaction with
reaction.user.fetch()
?11 replies
DIAdiscord.js - Imagine a boo! 👻
•Created by ManuelMaccou | Mosaic on 8/1/2023 in #djs-questions
getting partials for reactions when only ID is guaranteed
Thanks. I'm still learning about partials, but does this mean that if my bot restarts, users should still be able to react to a message and the proper code will trigger?
For example, I have this code:
But when the bot restarts, the reactions don't trigger the code. Do I need to replace something with reaction.emoji?
11 replies
DIAdiscord.js - Imagine a boo! 👻
•Created by ManuelMaccou | Mosaic on 6/5/2023 in #djs-questions
How to completely removing an emoji, not just the reactions
nvm. Figured it out 🙂
5 replies
DIAdiscord.js - Imagine a boo! 👻
•Created by ManuelMaccou | Mosaic on 6/5/2023 in #djs-questions
How to completely removing an emoji, not just the reactions
5 replies
DIAdiscord.js - Imagine a boo! 👻
•Created by ManuelMaccou | Mosaic on 5/31/2023 in #djs-questions
message.channel.parent undefined in forum channel?
Wouldnt this define it?
I'm a beginner so it might be an obvious "no"
13 replies
DIAdiscord.js - Imagine a boo! 👻
•Created by ManuelMaccou | Mosaic on 5/31/2023 in #djs-questions
message.channel.parent undefined in forum channel?
Ah got it. I was using the formatting within discord for the "code block"
13 replies
DIAdiscord.js - Imagine a boo! 👻
•Created by ManuelMaccou | Mosaic on 5/31/2023 in #djs-questions
message.channel.parent undefined in forum channel?
I did use code blocks...or at least I meant to. It showing as a block on my end
Uncaught Exception: TypeError: Cannot read properties of undefined (reading 'some')
13 replies
DIAdiscord.js - Imagine a boo! 👻
•Created by ManuelMaccou | Mosaic on 5/31/2023 in #djs-questions
message.channel.parent undefined in forum channel?
async function getAllowedChannels() {
try {
const { data: allowedChannels, error } = await supabase
.from('allowed_channels')
.select('channel_id, webhook_id, guild_id');
if (error) {
throw error;
}
return allowedChannels;
} catch (error) {
handleError('Error fetching allowed channels:' + error.message);
return [];
}
}
const allowedChannels = await getAllowedChannels();
if (allowedChannels.some(channel => channel.channel_id === message.channel.parent.id)) {
const messageData = { ...
13 replies
DIAdiscord.js - Imagine a boo! 👻
•Created by ManuelMaccou | Mosaic on 4/9/2023 in #djs-questions
Sending messages from a forum channel to database, but unable to grab the tags
Get me the manager....I need to tell them how amazing you are
31 replies
DIAdiscord.js - Imagine a boo! 👻
•Created by ManuelMaccou | Mosaic on 4/9/2023 in #djs-questions
Sending messages from a forum channel to database, but unable to grab the tags
I swear....If I could I'd give you the biggest hug
31 replies
DIAdiscord.js - Imagine a boo! 👻
•Created by ManuelMaccou | Mosaic on 4/9/2023 in #djs-questions
Sending messages from a forum channel to database, but unable to grab the tags
I assigned
const thread
back to message.thread
hoping that would fix the problem you pointed out
if (message.channel.type === 11) {
if (message.thread) {
const thread = message.thread;
const availableTags = message.channel.parent.availableTags;
const appliedTagIDs = thread.appliedTags;
appliedTags = appliedTagIDs.map(tagID => {
const foundTag = availableTags.find(tag => tag.id === tagID);
return foundTag ? foundTag.name : null;
}).filter(tagName => tagName !== null);
console.log('Applied tags:', appliedTags);
}
31 replies
DIAdiscord.js - Imagine a boo! 👻
•Created by ManuelMaccou | Mosaic on 4/9/2023 in #djs-questions
Sending messages from a forum channel to database, but unable to grab the tags
Regarding pulling in the tags
31 replies
DIAdiscord.js - Imagine a boo! 👻
•Created by ManuelMaccou | Mosaic on 4/9/2023 in #djs-questions
Sending messages from a forum channel to database, but unable to grab the tags
Not gonna lie, I'm pretty lost
31 replies
DIAdiscord.js - Imagine a boo! 👻
•Created by ManuelMaccou | Mosaic on 4/9/2023 in #djs-questions
Sending messages from a forum channel to database, but unable to grab the tags
I see. So probably better to add it back in to be safe. Thanks
31 replies
DIAdiscord.js - Imagine a boo! 👻
•Created by ManuelMaccou | Mosaic on 4/9/2023 in #djs-questions
Sending messages from a forum channel to database, but unable to grab the tags
I have another table that has approved channels. This code is only ran if the channel the message is sent in is one of those approved channels
31 replies
DIAdiscord.js - Imagine a boo! 👻
•Created by ManuelMaccou | Mosaic on 4/9/2023 in #djs-questions
Sending messages from a forum channel to database, but unable to grab the tags
ah ok thanks
31 replies
DIAdiscord.js - Imagine a boo! 👻
•Created by ManuelMaccou | Mosaic on 4/9/2023 in #djs-questions
Sending messages from a forum channel to database, but unable to grab the tags
I actually just deleted since I dont really need it. Is anything else sticking out as a problem?
// Getting new questions from Discord
client.on('messageCreate', async (message) => {
if (message.author.bot) return;
let appliedTags = [];
// Check if the message's channel is a GuildForum channel
if (message.channel.parent) {
const thread = message.channel.parent;
const availableTags = message.channel.parent.availableTags;
const appliedTagIDs = thread.appliedTags;
appliedTags = appliedTagIDs
.map((tagID) => {
const foundTag = availableTags.find((tag) => tag.id === tagID);
return foundTag ? foundTag.name : null;
})
.filter((tagName) => tagName !== null);
console.log('Applied tags:', appliedTags);
} else {
console.log(
[WARNING] The message object does not have a "thread" property.);
}
31 replies
DIAdiscord.js - Imagine a boo! 👻
•Created by ManuelMaccou | Mosaic on 4/9/2023 in #djs-questions
Sending messages from a forum channel to database, but unable to grab the tags
Is this instead of
channel
?31 replies
DIAdiscord.js - Imagine a boo! 👻
•Created by ManuelMaccou | Mosaic on 4/9/2023 in #djs-questions
Sending messages from a forum channel to database, but unable to grab the tags
Thanks. I'm pretty new at this, but took a crack at updating the code. Still not working though. Does anything stand out?
if (message.channel.type === "GUILD_FORUM") {
if (message.channel.parent) {
const thread = message.channel.parent;
const availableTags = message.channel.parent.availableTags;
const appliedTagIDs = message.channel.appliedTags;
appliedTags = appliedTagIDs.map(tagID => {
const foundTag = availableTags.find(tag => tag.id === tagID);
return foundTag ? foundTag.name : null;
}).filter(tagName => tagName !== null);
console.log('Applied tags:', appliedTags);
} else {
console.log(
[WARNING] The message object does not have a "thread" property.);
}
}
31 replies
DIAdiscord.js - Imagine a boo! 👻
•Created by ManuelMaccou | Mosaic on 4/8/2023 in #djs-questions
How to specify the ID of a forum channel?
That did it! Thank you very much
5 replies