feat: partially backport perms v2 for v13 (#8162)

This commit is contained in:
Almeida
2022-06-23 23:05:11 +01:00
committed by GitHub
parent c198e893c9
commit 125696fc79
4 changed files with 114 additions and 5 deletions

View File

@@ -143,6 +143,11 @@ client.on('ready', async () => {
const guildCommandFromGlobal = await client.application?.commands.fetch(guildCommandId, { guildId: testGuildId });
const guildCommandFromGuild = await client.guilds.cache.get(testGuildId)?.commands.fetch(guildCommandId);
await client.application?.commands.edit(globalCommandId, { defaultMemberPermissions: null });
await globalCommand?.edit({ defaultMemberPermissions: null });
await globalCommand?.setDefaultMemberPermissions(null);
await guildCommandFromGlobal?.edit({ dmPermission: false });
// @ts-expect-error
await client.guilds.cache.get(testGuildId)?.commands.fetch(guildCommandId, { guildId: testGuildId });
@@ -831,6 +836,14 @@ declare const applicationCommandManager: ApplicationCommandManager;
expectType<Promise<Collection<Snowflake, ApplicationCommand>>>(
applicationCommandManager.set([applicationCommandData], '0'),
);
applicationCommandManager.create({
name: 'yeet',
description: 'abc',
defaultMemberPermissions: 1n,
dmPermission: false,
type: 'CHAT_INPUT',
});
}
declare const applicationNonChoiceOptionData: ApplicationCommandOptionData & {