Closed TheFlash787 closed 2 years ago
Hi! I cant reproduce your issue. What version discord.js do you have installed?(Check in node_modules folder)
Hi! I cant reproduce your issue. What version discord.js do you have installed?(Check in node_modules folder)
Hey! In ./node_modules/discord.js
, the version is 13.7.0
. 🙂
My URLCommand file looks like this:
import { Command } from '@discord-nestjs/core';
import { URLCreateCommand } from './subcommand/create/create.command';
import { URLDeleteCommand } from './subcommand/delete/delete.command';
import { URLGetCommand } from './subcommand/get/get.command';
@Command({
name: 'url',
description: 'Manage all shortened URLs with this command',
include: [URLCreateCommand, URLDeleteCommand, URLGetCommand],
defaultPermission: false
})
export class URLCommand {}
My URLCommand file looks like this:
13.8.0 latest
Update to latest, please
@TheFlash787 hi your mistake is due to the fact that "slashCommandsPermissions" is no longer used. Starting from mid-April, the rights to use the team are now set only by guild administrators. link: https://discordjs.guide/interactions/slash-commands.html#slash-command-permissions
@TheFlash787 hi your mistake is due to the fact that "slashCommandsPermissions" is no longer used. Starting from mid-April, the rights to use the team are now set only by guild administrators. link: https://discordjs.guide/interactions/slash-commands.html#slash-command-permissions
Unfortunately I'm not too sure what you mean here. slashCommandsPermissions is a Discord NestJS implementation, not DiscordJS.
Update to latest, please
Huge apologies for the delay! I have updated to DiscordJS 13.8, and also made sure my Discord NestJS versions were up to date however I'm still experiencing this issue.
I have replicated this using your command sample. It looks like, simply adding slashCommandsPermissions
with the PlayCommand
causes it to occur and print out 'Bots cannot use this endpoint' -- even if I leave permissions
empty after specifying the command class type.
If you do the same, do you run into this issue? @fjodor-rybakov
The issue must be caused here, surely, as it hasn't been updated to match the new Discord integration permission system they released a month or so ago: https://github.com/fjodor-rybakov/discord-nestjs/blob/8e5faf5d11cdf795f229d0c103afbbcc216b15f7/packages/core/src/services/register-command.service.ts#L228
DiscordJS:
The issue must be caused here, surely, as it hasn't been updated to match the new Discord integration permission system they released a month or so ago:
DiscordJS:
Can you make pull request?
The issue must be caused here, surely, as it hasn't been updated to match the new Discord integration permission system they released a month or so ago: https://github.com/fjodor-rybakov/discord-nestjs/blob/8e5faf5d11cdf795f229d0c103afbbcc216b15f7/packages/core/src/services/register-command.service.ts#L228
DiscordJS:
Can you make pull request?
Unfortunately I'm not too confident that I can commit time to this, but if I can, I will for sure take a look. Nonetheless, if you have anything down the line you would like my help testing, please don't hesitate to let me know.
@fjodor-rybakov Since this error is still occuring and easily replicatable with slashComandPermissions
in use on the sample projects, is it possible we could re-open this issue so that we can track our resolution process?
Alright, so this will be fairly easy to accomplish once this is complete -- we may just need to rework how the permissions are handled a little, but the tools should be there: https://github.com/discordjs/discord.js/pull/8162
We would basically need to change await command.permissions.set({ permissions });
to use the command.setDefaultXXX
methods when this PR is accessible for us to use in DiscordJS v13.
Alright, so this will be fairly easy to accomplish once this is complete -- we may just need to rework how the permissions are handled a little, but the tools should be there: discordjs/discord.js#8162
We would basically need to change
await command.permissions.set({ permissions });
to use thecommand.setDefaultXXX
methods when this PR is accessible for us to use in DiscordJS v13.
Hi! Can you check your issue in the new version?
I will migrate to v14 and let you know 🙂
Alright, so this will be fairly easy to accomplish once this is complete -- we may just need to rework how the permissions are handled a little, but the tools should be there: discordjs/discord.js#8162 We would basically need to change
await command.permissions.set({ permissions });
to use thecommand.setDefaultXXX
methods when this PR is accessible for us to use in DiscordJS v13.Hi! Can you check your issue in the new version?
@fjodor-rybakov After updating, it looks like this still occurs -- but with a different error. Do you know why this might be? It continues only to occur when slashCommandPermissions is populated.
slashCommandsPermissions: [
{
commandClassType: MyCommand,
permissions: [
{
id: '000-my-role-id',
type: ApplicationCommandPermissionType.Role,
permission: true
}
]
}
]
Alright, so this will be fairly easy to accomplish once this is complete -- we may just need to rework how the permissions are handled a little, but the tools should be there: discordjs/discord.js#8162 We would basically need to change
await command.permissions.set({ permissions });
to use thecommand.setDefaultXXX
methods when this PR is accessible for us to use in DiscordJS v13.Hi! Can you check your issue in the new version?
@fjodor-rybakov After updating, it looks like this still occurs -- but with a different error. Do you know why this might be? It continues only to occur when slashCommandPermissions is populated.
slashCommandsPermissions: [ { commandClassType: MyCommand, permissions: [ { id: '000-my-role-id', type: ApplicationCommandPermissionType.Role, permission: true } ] } ]
Since you can no longer set permissions through the bot, I removed the misleading functionality
Describe the bug I've updated my Discord NestJS to version (3.3.4) but unfortunately I'm still running into issues with registering Discord slash commands with permissions.
To Reproduce My configuration is as follows (I have removed all commands that were not required to produce the error, it looks like any command triggers it):
Expected behavior Prior to the DiscordAPI command changes, this configuration worked as expected and commands were protected by the needed permissions.