mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 02:53:31 +01:00
types(ApplicationCommand): fix option name (#6067)
* types(ApplicationCommand): fix option name * fix(ApplicationCommand): update tests * fix(ApplicationCommand): fix error param
This commit is contained in:
@@ -60,7 +60,7 @@ client.on('ready', async () => {
|
||||
guild: testGuildId,
|
||||
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
|
||||
});
|
||||
await globalPermissionsManager?.has({ command: globalCommandId, guild: testGuildId, permissionsId: testGuildId });
|
||||
await globalPermissionsManager?.has({ command: globalCommandId, guild: testGuildId, permissionId: testGuildId });
|
||||
await globalPermissionsManager?.fetch({ guild: testGuildId });
|
||||
await globalPermissionsManager?.fetch({ command: globalCommandId, guild: testGuildId });
|
||||
await globalPermissionsManager?.remove({ command: globalCommandId, guild: testGuildId, roles: [testGuildId] });
|
||||
@@ -87,7 +87,7 @@ client.on('ready', async () => {
|
||||
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
|
||||
});
|
||||
// @ts-expect-error
|
||||
await globalPermissionsManager?.has({ command: globalCommandId, permissionsId: testGuildId });
|
||||
await globalPermissionsManager?.has({ command: globalCommandId, permissionId: testGuildId });
|
||||
// @ts-expect-error
|
||||
await globalPermissionsManager?.fetch();
|
||||
// @ts-expect-error
|
||||
@@ -120,7 +120,7 @@ client.on('ready', async () => {
|
||||
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
|
||||
});
|
||||
// @ts-expect-error
|
||||
await globalPermissionsManager?.has({ guild: testGuildId, permissionsId: testGuildId });
|
||||
await globalPermissionsManager?.has({ guild: testGuildId, permissionId: testGuildId });
|
||||
// @ts-expect-error
|
||||
await globalPermissionsManager?.remove({ guild: testGuildId, roles: [testGuildId] });
|
||||
// @ts-expect-error
|
||||
@@ -138,7 +138,7 @@ client.on('ready', async () => {
|
||||
command: globalCommandId,
|
||||
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
|
||||
});
|
||||
await guildPermissionsManager?.has({ command: globalCommandId, permissionsId: testGuildId });
|
||||
await guildPermissionsManager?.has({ command: globalCommandId, permissionId: testGuildId });
|
||||
await guildPermissionsManager?.fetch({});
|
||||
await guildPermissionsManager?.fetch({ command: globalCommandId });
|
||||
await guildPermissionsManager?.remove({ command: globalCommandId, roles: [testGuildId] });
|
||||
@@ -159,7 +159,7 @@ client.on('ready', async () => {
|
||||
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
|
||||
});
|
||||
// @ts-expect-error
|
||||
await guildPermissionsManager?.has({ command: globalCommandId, guild: testGuildId, permissionsId: testGuildId });
|
||||
await guildPermissionsManager?.has({ command: globalCommandId, guild: testGuildId, permissionId: testGuildId });
|
||||
// @ts-expect-error
|
||||
await guildPermissionsManager?.fetch({ guild: testGuildId });
|
||||
// @ts-expect-error
|
||||
@@ -190,7 +190,7 @@ client.on('ready', async () => {
|
||||
// @ts-expect-error
|
||||
await guildPermissionsManager?.add({ permissions: [{ type: 'ROLE', id: testGuildId, permission: true }] });
|
||||
// @ts-expect-error
|
||||
await guildPermissionsManager?.has({ permissionsId: testGuildId });
|
||||
await guildPermissionsManager?.has({ permissionId: testGuildId });
|
||||
// @ts-expect-error
|
||||
await guildPermissionsManager?.remove({ roles: [testGuildId] });
|
||||
// @ts-expect-error
|
||||
@@ -210,7 +210,7 @@ client.on('ready', async () => {
|
||||
guild: testGuildId,
|
||||
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
|
||||
});
|
||||
await globalCommand?.permissions.has({ guild: testGuildId, permissionsId: testGuildId });
|
||||
await globalCommand?.permissions.has({ guild: testGuildId, permissionId: testGuildId });
|
||||
await globalCommand?.permissions.fetch({ guild: testGuildId });
|
||||
await globalCommand?.permissions.remove({ guild: testGuildId, roles: [testGuildId] });
|
||||
await globalCommand?.permissions.remove({ guild: testGuildId, users: [testUserId] });
|
||||
@@ -227,7 +227,7 @@ client.on('ready', async () => {
|
||||
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
|
||||
});
|
||||
// @ts-expect-error
|
||||
await globalCommand?.permissions.has({ command: globalCommandId, guild: testGuildId, permissionsId: testGuildId });
|
||||
await globalCommand?.permissions.has({ command: globalCommandId, guild: testGuildId, permissionId: testGuildId });
|
||||
// @ts-expect-error
|
||||
await globalCommand?.permissions.fetch({ command: globalCommandId, guild: testGuildId });
|
||||
// @ts-expect-error
|
||||
@@ -251,7 +251,7 @@ client.on('ready', async () => {
|
||||
// @ts-expect-error
|
||||
await globalCommand?.permissions.add({ permissions: [{ type: 'ROLE', id: testGuildId, permission: true }] });
|
||||
// @ts-expect-error
|
||||
await globalCommand?.permissions.has({ permissionsId: testGuildId });
|
||||
await globalCommand?.permissions.has({ permissionId: testGuildId });
|
||||
// @ts-expect-error
|
||||
await globalCommand?.permissions.fetch({});
|
||||
// @ts-expect-error
|
||||
@@ -265,7 +265,7 @@ client.on('ready', async () => {
|
||||
|
||||
// Permissions from cached guild ApplicationCommand
|
||||
await guildCommandFromGlobal?.permissions.add({ permissions: [{ type: 'ROLE', id: testGuildId, permission: true }] });
|
||||
await guildCommandFromGlobal?.permissions.has({ permissionsId: testGuildId });
|
||||
await guildCommandFromGlobal?.permissions.has({ permissionId: testGuildId });
|
||||
await guildCommandFromGlobal?.permissions.fetch({});
|
||||
await guildCommandFromGlobal?.permissions.remove({ roles: [testGuildId] });
|
||||
await guildCommandFromGlobal?.permissions.remove({ users: [testUserId] });
|
||||
@@ -278,7 +278,7 @@ client.on('ready', async () => {
|
||||
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
|
||||
});
|
||||
// @ts-expect-error
|
||||
await guildCommandFromGlobal?.permissions.has({ command: guildCommandId, permissionsId: testGuildId });
|
||||
await guildCommandFromGlobal?.permissions.has({ command: guildCommandId, permissionId: testGuildId });
|
||||
// @ts-expect-error
|
||||
await guildCommandFromGlobal?.permissions.remove({ command: guildCommandId, roles: [testGuildId] });
|
||||
// @ts-expect-error
|
||||
@@ -301,7 +301,7 @@ client.on('ready', async () => {
|
||||
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
|
||||
});
|
||||
// @ts-expect-error
|
||||
await guildCommandFromGlobal?.permissions.has({ guild: testGuildId, permissionsId: testGuildId });
|
||||
await guildCommandFromGlobal?.permissions.has({ guild: testGuildId, permissionId: testGuildId });
|
||||
// @ts-expect-error
|
||||
await guildCommandFromGlobal?.permissions.remove({ guild: testGuildId, roles: [testGuildId] });
|
||||
// @ts-expect-error
|
||||
@@ -315,7 +315,7 @@ client.on('ready', async () => {
|
||||
});
|
||||
|
||||
await guildCommandFromGuild?.permissions.add({ permissions: [{ type: 'ROLE', id: testGuildId, permission: true }] });
|
||||
await guildCommandFromGuild?.permissions.has({ permissionsId: testGuildId });
|
||||
await guildCommandFromGuild?.permissions.has({ permissionId: testGuildId });
|
||||
await guildCommandFromGuild?.permissions.fetch({});
|
||||
await guildCommandFromGuild?.permissions.remove({ roles: [testGuildId] });
|
||||
await guildCommandFromGuild?.permissions.remove({ users: [testUserId] });
|
||||
@@ -328,7 +328,7 @@ client.on('ready', async () => {
|
||||
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
|
||||
});
|
||||
// @ts-expect-error
|
||||
await guildCommandFromGuild?.permissions.has({ command: guildCommandId, permissionsId: testGuildId });
|
||||
await guildCommandFromGuild?.permissions.has({ command: guildCommandId, permissionId: testGuildId });
|
||||
// @ts-expect-error
|
||||
await guildCommandFromGuild?.permissions.remove({ command: guildCommandId, roles: [testGuildId] });
|
||||
// @ts-expect-error
|
||||
@@ -351,7 +351,7 @@ client.on('ready', async () => {
|
||||
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
|
||||
});
|
||||
// @ts-expect-error
|
||||
await guildCommandFromGuild?.permissions.has({ guild: testGuildId, permissionsId: testGuildId });
|
||||
await guildCommandFromGuild?.permissions.has({ guild: testGuildId, permissionId: testGuildId });
|
||||
// @ts-expect-error
|
||||
await guildCommandFromGuild?.permissions.remove({ guild: testGuildId, roles: [testGuildId] });
|
||||
// @ts-expect-error
|
||||
|
||||
Reference in New Issue
Block a user