bot: clearer hint when Activities aren't enabled; keep the Activity entry-point command on global registration
This commit is contained in:
1 parent
2e04d9efb4
commit
4d900c5b56
3 files changed
+14
-4
No files matched your search
@@ -20,7 +20,11 @@ async function main() {
|
||||
console.log(`guild ${g}: ${res.length} commands`);
|
||||
}
|
||||
} else {
|
||||
const res = await rest.put(Routes.applicationCommands(cfg.applicationId), { body });
|
||||
// keep Discord's Activity entry-point command (type 4): a bulk overwrite without it fails
|
||||
const existing = await rest.get(Routes.applicationCommands(cfg.applicationId));
|
||||
const res = await rest.put(Routes.applicationCommands(cfg.applicationId), {
|
||||
body: [...body, ...existing.filter((c) => c.type === 4)],
|
||||
});
|
||||
console.log(`global: ${res.length} commands (may take up to an hour to appear)`);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user