question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`ApplicationCommandPermissionsManager#fetch` typings issue

See original GitHub issue

Which package is this bug report for?

discord.js

Issue description

  1. Have a guild and try to fetch application command permissions using provided code sample.
  2. According to documentation, options parameter should be optional in the code sample below.
  3. However, typescript complains that options parameter wasn’t provided.

Code sample

client.on('messageCreate', message => {
  if (!message.inGuild()) return;
  
  const permissions = message.guild.commands.permissions.fetch()
})

Package version

discord.js@14.0.0-dev.1655165434-b4e28a8

Node.js version

16.15.1, typescript 4.7.3

Operating system

Windows

Priority this issue should have

Medium (should be fixed soon)

Which partials do you have configured?

No Partials

Which gateway intents are you subscribing to?

Guilds, GuildMembers, GuildMessages

I have tested this issue on a development release

b4e28a8

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
almeidxcommented, Jun 14, 2022

To workaround this issue you can just pass an empty object i.e message.guild.commands.permissions.fetch({})

0reactions
MarcusOttercommented, Nov 19, 2022

Figured an update 2 months later would be helpful for maintainers as they come in here and need to figure out if someone accidentally fixed this already. It wasn’t a complaint, just info for anyone that wants to tackle it in the future. Feel free to mark as off-topic.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Updating from v12 to v13 - discord.js Guide
User#typingIn. As discord. js no longer caches typing event data, the User. typingIn() method has been removed.
Read more >
chrome.permissions - Chrome Developers
Use the chrome.permissions API to request declared optional permissions at run time rather than install time, so users understand why the permissions are ......
Read more >
Discord JS - DiscordAPIError: Missing Access - Stack Overflow
And for the scope select both "bot" and "applications.commands". Then scroll down choose whatever permission your bot need copy the URL.
Read more >
Permission to Slash, Granted: Introducing Slash Command ...
Wow, it looks like you're all having a fabulous time using slash commands! /so /many /cool /things. Apps on Discord have been around...
Read more >
API Reference - Discord.py
application_id ( int ) – The client's application ID. intents ( Intents ) –. The intents that you want to enable for the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found