diff --git a/src/classes/TTSClient.ts b/src/classes/TTSClient.ts index 465d999..7e52b42 100644 --- a/src/classes/TTSClient.ts +++ b/src/classes/TTSClient.ts @@ -62,7 +62,7 @@ export class TTSClient { } text = this.textEditor(channel.guild, text); - const buf = await this.getSorce(text); + const buf = await this.getSource(text); if (!buf) return; const session = this.getSession(channel.guild, voiceChannel); @@ -91,7 +91,7 @@ export class TTSClient { } - private async getSorce(text: string): Promise { + private async getSource(text: string): Promise { const parts = text.split(signature.regex); const bufferList: Buffer[] = []; @@ -119,11 +119,11 @@ export class TTSClient { if (text.length === 0) return "파일"; return text .replace(URL_RE, (u) => labelForUrl(u) ?? u) - .replace(/\<\@\!?[(0-9)]{18}\>/g, (t) => { - const member = guild.members.cache.get(t.replace(/[^0-9]/g,"")); + .replace(/<@!?(\d{17,20})>/g, (_t, id: string) => { + const member = guild.members.cache.get(id); return member?.nickname ?? member?.user.username ?? "유저"; }) - .replace(/\/g, () => { + .replace(//g, () => { return "이모티콘"; }); }