diff --git a/bot/src/server/server.ts b/bot/src/server/server.ts index e073541b6..270f26759 100644 --- a/bot/src/server/server.ts +++ b/bot/src/server/server.ts @@ -97,12 +97,12 @@ app.get("/oauth/callback", async (req, res) => { const user = whoamiRes.body; - logger.info(`Saving user-discord-link for ${user.username} (#${user.id}).`); + logger.info(`Saving user-discord-link for ${user.username} (id: ${user.id}).`); const existingLink = await db.discordUserMap.findOne({ userID: user.id }); if (existingLink) { - logger.info(`Updating user-discord-link for ${user.username} (#${user.id})`); + logger.info(`Updating user-discord-link for ${user.username} (id: ${user.id})`); await db.discordUserMap.update( { diff --git a/bot/src/slashCommands/register.ts b/bot/src/slashCommands/register.ts index 7d9d630fa..5219a2de0 100644 --- a/bot/src/slashCommands/register.ts +++ b/bot/src/slashCommands/register.ts @@ -66,17 +66,15 @@ export async function UnregisterAllCommands(client: Client): Promise { const promises = []; for (const [, guild] of guilds) { - const commands = guild.commands.cache; - - for (const [, command] of commands) { - promises.push(command.delete()); - } + promises.push(guild.commands.set([])); } + await client.application!.commands.set([]); + // parallelise waiting for these to be deleted. await Promise.all(promises); - logger.info("Successfully tidied old guild slash commands."); + logger.info(`Successfully tidied ${promises.length} old guild slash commands.`); } catch (err) { logger.error("Failed to tidy old guild slash commands.", err); diff --git a/bot/src/utils/embeds.ts b/bot/src/utils/embeds.ts index aefbab8d8..e7ddf3e15 100644 --- a/bot/src/utils/embeds.ts +++ b/bot/src/utils/embeds.ts @@ -63,7 +63,7 @@ export function CreateImportEmbed(importDoc: ImportDocument) { export function CreateUserEmbed(userDoc: PublicUserDocument) { return CreateEmbed() - .setTitle(`${userDoc.username} (#${userDoc.id})`) + .setTitle(`${userDoc.username} (ID: ${userDoc.id})`) .setThumbnail(PrependTachiUrl(`/users/${userDoc.id}/pfp`)) .setDescription(userDoc.status ?? "No status...") .addField("Join Date", FormatDate(userDoc.joinDate))