Discord.js でスラッシュコマンドの登録を解除する方法

結論

空のコマンドの配列 [] を登録する。

discord.js Guideこちらのページ の例でいうと、次のようになります(関連箇所だけを抜粋)。

rest.put(Routes.applicationGuildCommands(clientId, guildId), { body: [] })
    .then(() => console.log('Successfully registered application commands.'))
    .catch(console.error);

原文では rest.put(Routes.applicationGuildCommands(clientId, guildId), { body: commands }) としているところ、空の配列を送っています。

Powered by はてなブログ