File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -451,10 +451,16 @@ IrcClient.prototype.action = function(target, message) {
451451 // Maximum length of target + message we can send to the IRC server is 500 characters
452452 // but we need to leave extra room for the sender prefix so the entire message can
453453 // be sent from the IRCd to the target without being truncated.
454- var blocks = truncateString ( message , this . options . message_max_length ) ;
454+
455+ // The block length here is the max, but without the non-content characters:
456+ // the command name, the space, and the two SOH chars
457+
458+ var commandName = 'ACTION' ;
459+ var blockLength = this . options . message_max_length - ( commandName . length + 3 ) ;
460+ var blocks = truncateString ( message , blockLength ) ;
455461
456462 blocks . forEach ( function ( block ) {
457- that . ctcpRequest ( target , 'ACTION' , block ) ;
463+ that . ctcpRequest ( target , commandName , block ) ;
458464 } ) ;
459465
460466 return blocks ;
You can’t perform that action at this time.
0 commit comments