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

feat(GuildScheduledEvent): add partial and fetch support #9801

Closed
wants to merge 1 commit into from

Conversation

GradyRoberts
Copy link

@GradyRoberts GradyRoberts commented Aug 24, 2023

Please describe the changes this PR makes and why it should be merged:
The documentation specifies that the GuildScheduledEvent class supports partials but it is not fully implemented:

TypeError: guildScheduledEvent.fetch is not a function

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • This PR changes the library's interface (methods or parameters added)

Local Testing

console.log(`Received GuildScheduledEventUserAdd`);
if (guildScheduledEvent.partial) {
    console.log("Partial guildScheduledEvent, fetching...");
    await guildScheduledEvent.fetch();
}
console.log(guildScheduledEvent);

Output:

Received GuildScheduledEventUserAdd
Partial guildScheduledEvent, fetching...
GuildScheduledEvent {
  id: '1144080228373770280',
  guildId: '859588661548417086',
  channelId: '859588662606168077',
  creatorId: '163032275074678784',
  name: 'tset',
  description: '',
  scheduledStartTimestamp: 1692842400207,
  scheduledEndTimestamp: null,
  privacyLevel: 2,
  status: 1,
  entityType: 2,
  entityId: null,
  userCount: 1,
  creator: User {
    id: '163032275074678784',
    bot: false,
    system: false,
    flags: UserFlagsBitField { bitfield: 0 },
    username: '.grob',
    globalName: 'grob',
    discriminator: '0',
    avatar: '3bf4e6f77edfa65ed5398b4b16c14ded',
    banner: null,
    accentColor: 1710104,
    avatarDecoration: null
  },
  entityMetadata: { location: null },
  image: null
}

@GradyRoberts GradyRoberts requested a review from a team as a code owner August 24, 2023 04:01
@vercel
Copy link

vercel bot commented Aug 24, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
discord-js ⬜️ Ignored (Inspect) Visit Preview Aug 24, 2023 4:01am
discord-js-guide ⬜️ Ignored (Inspect) Visit Preview Aug 24, 2023 4:01am

@github-actions
Copy link

github-actions bot commented Aug 24, 2023

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟢 Performance 94
🟢 Accessibility 96
🟢 Best practices 100
🟠 SEO 67
🔴 PWA 33

Lighthouse ran on https://discord-js-git-fork-gradyroberts-main-discordjs.vercel.app/

@GradyRoberts
Copy link
Author

Closing as duplicate #9802

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants