This commit is contained in:
nicksales72
2026-03-13 09:00:58 -04:00
parent 4c04aa45ad
commit 5bc6d147c4

View File

@@ -66,20 +66,16 @@ export async function createInvite(opts: {
await createNotification(member.userId, 'match_invite', title, notifMessage, invite.id);
}
// Send Bancho DMs (best-effort)
// Send Bancho DMs (best-effort)
for (const member of invitedMembers) {
try {
const u = await db.query.user.findFirst({
where: eq(user.id, member.userId)
});
if (u?.name) {
await sendDM(
u.name,
`Match invite: ${title}. Accept/decline at https://esports.vash.software/matches or reply !accept ${invite.id.slice(0, 8)}`
);
}
} catch {
// DM sending is best-effort
const u = await db.query.user.findFirst({
where: eq(user.id, member.userId)
});
if (u?.name) {
sendDM(
u.name,
`Match invite: ${title}. Accept/decline at https://esports.vash.software/matches or reply !accept ${invite.id.slice(0, 8)}`
).catch(() => {}); // Silent best-effort
}
}