Trying to create a external schedule event. Here is my function that causes the error.
Error [GuildVoiceChannelResolve]: Could not resolve channel to a guild voice channel
async function handleWordPressEvent(client, eventData) {
console.log("Handling WordPress event:", eventData);
const guild = client.guilds.cache.get(process.env.GUILD_ID);
if (!guild) {
console.error("Guild not found");
return;
}
// Create an external event
try {
const event = await guild.scheduledEvents.create({
name: eventData.title,
description: Event powered by the Trade the Fund calendar. ,
startAt: new Date(eventData.start_date),
endAt: new Date(eventData.end_date),
entityType: EXTERNAL ,
privacyLevel: GUILD_ONLY ,
location: eventData.link,
coverImage: eventData.cover_image,
});
console.log(`Created a new external event with ID: ${event.id}`);
} catch (error) {
console.error("Error creating the external event:", error);
}
}
I don t want a channel id and want to keep it external. so tried setting channel and channelId to null but didn t seem to work.
const event = await guild.scheduledEvents.create({
channel: null, // Try explicitly setting this to null
channelId: null, // Explicitly set this to null
name: Sample Event ,
description: A sample description for our event. ,
scheduledStartTime: new Date(),
privacyLevel: GUILD_ONLY ,
entityType: EXTERNAL
});
any help would be awesome!