mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-05 21:38:06 +03:00
fix: make userID clearer in user embeds
This commit is contained in:
@@ -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(
|
||||
{
|
||||
|
||||
@@ -66,17 +66,15 @@ export async function UnregisterAllCommands(client: Client): Promise<void> {
|
||||
|
||||
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);
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user