Skip to content

Commit 2976c85

Browse files
committed
Reuse _splitMessage when handling actions
1 parent e3eb9c1 commit 2976c85

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/irc.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,9 +1407,11 @@ export class Client extends EventEmitter {
14071407
if (typeof text === 'undefined') {
14081408
return;
14091409
}
1410-
await Promise.all(text.toString().split(/\r?\n/).filter((line) =>
1411-
line.length > 0
1412-
).map((line) => this.say(channel, '\u0001ACTION ' + line + '\u0001')));
1410+
await Promise.all(
1411+
this._splitMessage(
1412+
channel + '\u0001ACTION ' + '\u0001', text
1413+
).map((line) => this.say(channel, '\u0001ACTION ' + line + '\u0001'))
1414+
);
14131415
}
14141416

14151417
// E.g. isUserPrefixMorePowerfulThan("@", "&")

0 commit comments

Comments
 (0)