.catch()
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user