diff --git a/packages/api/utils/import-from-legacy.ts b/packages/api/utils/import-from-legacy.ts index 5c559ab..31b0246 100644 --- a/packages/api/utils/import-from-legacy.ts +++ b/packages/api/utils/import-from-legacy.ts @@ -44,11 +44,13 @@ export const transformLegacyGuild = (guild: LegacyGuildData): GuildData => { id: guild.id, message: guild.message, features: Features.LegacyGuild, - categories: sortBy(guild.categories, 'position').map((category, idx) => ({ - ...category, - id: KSUID.randomSync().string, - position: idx, // Reset positions by index. May have side-effects but oh well. - type: category.type === 'multi' ? CategoryType.Multi : CategoryType.Single, - })), + categories: sortBy(Object.values(guild.categories), 'position').map( + (category, idx) => ({ + ...category, + id: KSUID.randomSync().string, + position: idx, // Reset positions by index. May have side-effects but oh well. + type: category.type === 'multi' ? CategoryType.Multi : CategoryType.Single, + }) + ), }; }; diff --git a/packages/api/worker.config.js b/packages/api/worker.config.js index 3cb26d9..b73f304 100644 --- a/packages/api/worker.config.js +++ b/packages/api/worker.config.js @@ -7,6 +7,7 @@ module.exports = { 'BOT_CLIENT_ID', 'BOT_CLIENT_SECRET', 'BOT_TOKEN', + 'BOT_IMPORT_TOKEN', 'UI_PUBLIC_URI', 'API_PUBLIC_URI', 'ROOT_USERS',