Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Commit

Permalink
Don't crash on empty pings
Browse files Browse the repository at this point in the history
  • Loading branch information
aronson committed Nov 15, 2023
1 parent 4e930b3 commit 48cac96
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/mediator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,10 @@ export class Mediator {
input,
/([^@\s:,]+):|@([^\s]+)?/g,
async (match, colonRef, atRef) => {
const reference: string = colonRef || atRef;
const reference: string | undefined = colonRef || atRef;
if (!reference) {
return match;
}
// Remove discriminator from bot mentions
const member = await this.getDiscordUserByString(reference.split('#')[0], this.guild);

Expand Down

0 comments on commit 48cac96

Please sign in to comment.