Skip to content

Commit

Permalink
Reuse _splitMessage when handling actions
Browse files Browse the repository at this point in the history
  • Loading branch information
tadzik committed Apr 29, 2022
1 parent e3eb9c1 commit 2976c85
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/irc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1407,9 +1407,11 @@ export class Client extends EventEmitter {
if (typeof text === 'undefined') {
return;
}
await Promise.all(text.toString().split(/\r?\n/).filter((line) =>
line.length > 0
).map((line) => this.say(channel, '\u0001ACTION ' + line + '\u0001')));
await Promise.all(
this._splitMessage(
channel + '\u0001ACTION ' + '\u0001', text
).map((line) => this.say(channel, '\u0001ACTION ' + line + '\u0001'))
);
}

// E.g. isUserPrefixMorePowerfulThan("@", "&")
Expand Down

0 comments on commit 2976c85

Please sign in to comment.