Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scheduled Events missing "location" for entityType: external #10204

Closed
IDootix opened this issue Apr 3, 2024 · 1 comment
Closed

Scheduled Events missing "location" for entityType: external #10204

IDootix opened this issue Apr 3, 2024 · 1 comment

Comments

@IDootix
Copy link

IDootix commented Apr 3, 2024

Which package is this bug report for?

discord.js

Issue description

Try to create an Scheduled Discord Event with an entity type of external dont set a channel because it's external and get invalid from error from the discord api

ERROR: An unhandled promise rejection occurred.
shardId: 0
message: "Invalid Form Body\nentity_metadata.location[BASE_TYPE_REQUIRED]: This field is required"
code: 50035
statusCode: 400
method: "POST"
url: "https://discord.com/api/v10/guilds/1223361272998002758/scheduled-events"
stack: "DiscordAPIError[50035]: Invalid Form Body\nentity_metadata.location[BASE_TYPE_REQUIRED]: This field is required

Code sample

public async execute(intr: ChatInputCommandInteraction): Promise<void> {
        //create an example Date
        let date = new Date();
        date.setFullYear(2022);

        //create an event
        intr.guild.scheduledEvents.create({
            name: 'example',
            scheduledStartTime: date,
            privacyLevel: GuildScheduledEventPrivacyLevel.GuildOnly,
            entityType: GuildScheduledEventEntityType.External,
        });
    }

Versions

  • discord.js 14.14.1
  • typescript 5.4.2
  • node 18.19.1

Issue priority

Medium (should be fixed soon)

Which partials do you have configured?

Channel, Message, Reaction

Which gateway intents are you subscribing to?

Guilds, GuildMessages, GuildMessageReactions, DirectMessages, DirectMessageReactions

I have tested this issue on a development release

No response

@IDootix IDootix changed the title Scheduled Events missiong "location" for entityType: external Scheduled Events missing "location" for entityType: external Apr 3, 2024
@almeidx
Copy link
Member

almeidx commented Apr 3, 2024

As outlined in the error message, you didn't set the entity metadata location (entityMetadata.location), which is required for external events.

@IDootix IDootix closed this as completed Apr 3, 2024
@almeidx almeidx closed this as not planned Won't fix, can't repro, duplicate, stale Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants