Skip to content

Commit 7d3b6fa

Browse files
committed
Distribute user join log to sentry
1 parent 221bf10 commit 7d3b6fa

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/events/discordEvents.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { DiscordCommandHandler } from "./helper/DiscordCommandHandler";
1313
import { VertificationHandler } from "./helper/DiscordConfirmBtn";
1414
import { DiscordUser } from "../utils/DiscordUser";
1515
import { APIErrors } from "../utils/discordErrorCode";
16-
import { captureException, withScope } from "@sentry/node-core";
16+
import { captureException, logger, withScope } from "@sentry/node-core";
1717
import { BannerPic } from "../utils/bannerGen";
1818
import { Prisma } from "@prisma/client";
1919
import { randomUUID } from "crypto";
@@ -267,12 +267,16 @@ export class DiscordEvents extends baseEvent {
267267
]);
268268

269269
// See if username needs to be added as well
270-
if(now.member.user.username !== now.member.user.displayName)
270+
const UNMatchDN = now.member.user.username === now.member.user.displayName;
271+
if(!UNMatchDN)
271272
embed.addFields({
272273
name: "Username",
273274
value: now.member.user.username
274275
});
275276

277+
logger.info(logger.fmt`${now.member.user[UNMatchDN ? "username" : "displayName"]} joined voice channel: ${now.channel.name}`, {
278+
channelID: now.channel.id
279+
});
276280
await channel.send({ embeds: [embed] });
277281
} catch(ex) { captureException(ex, { mechanism: { handled: false } }); }
278282
});

0 commit comments

Comments
 (0)