Skip to content

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

Closed
@mallusrgreatv2

Description

@mallusrgreatv2

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

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions