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

Property '#private' in type 'REST' refers to a different member that cannot be accessed from within type 'REST'. #9985

Closed
mallusrgreatv2 opened this issue Nov 18, 2023 · 0 comments · Fixed by #10009

Comments

@mallusrgreatv2
Copy link

mallusrgreatv2 commented Nov 18, 2023

Which package is this bug report for?

create-discord-bot

Issue description

Steps

  1. Do yarn create discord-bot.
  2. In options use typescript.
  3. In src/util/deploy.ts, error occurs.
Argument of type 'import("(location of bot code)/node_modules/@discordjs/rest/dist/index").REST' is not assignable to parameter of type 'import("(location of bot code)/node_modules/@discordjs/rest/dist/index", { assert: { "resolution-mode": "import" } }).REST'.
  Property '#private' in type 'REST' refers to a different member that cannot be accessed from within type 'REST'.ts(2345)

Code sample

import process from 'node:process';
import { URL } from 'node:url';
import { API } from '@discordjs/core/http-only';
import { REST } from 'discord.js';
import { loadCommands } from './loaders.ts';

const commands = await loadCommands(new URL('../commands/', import.meta.url));
const commandData = [...commands.values()].map((command) => command.data);

const rest = new REST({ version: '10' }).setToken(process.env.DISCORD_TOKEN!);
const api = new API(rest);

const result = await api.applicationCommands.bulkOverwriteGlobalCommands(process.env.APPLICATION_ID!, commandData);

console.log(`Successfully registered ${result.length} commands.`);

Versions

  • discord.js@14.14.1
  • typescript@5.2.2
  • node v20.8.0

Issue priority

Low (no impact on functionality)

Which partials do you have configured?

Not applicable

Which gateway intents are you subscribing to?

Not applicable

I have tested this issue on a development release

No response

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

Successfully merging a pull request may close this issue.

3 participants