When I run my sendChat command, I get the following error: /home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:1 orts, require, module, __filename, __dirname) { function g(a){throw a;}var j=v ^ TypeError: Object 0 has no method 'replace' at _substituteShortForms ( The command I am running is: /roll (floor((@{Mac McBigMac|tp}-9)/10)+1)*(100*(((@{Mac McBigMac|tp}-9)/10)+1)) And @{Mac McBigMac|tp} resolves to: (floor(((10+(ceil((0-110)/9999999999))+(ceil((0-120)/9999999999))+(ceil((0-130)/9999999999))+(ceil((0-140)/9999999999))+(ceil((0-150)/9999999999))+(ceil((0-160)/9999999999))+(ceil((0-170)/9999999999))+(ceil((0-180)/9999999999))+(ceil((0-190)/9999999999))+(ceil((0-400)/9999999999))+(ceil((0-420)/9999999999))+(ceil((0-440)/9999999999))+(ceil((0-460)/9999999999))+(ceil((0-480)/9999999999))+(ceil((0-500)/9999999999))+(ceil((0-520)/9999999999))+(ceil((0-540)/9999999999))+(ceil((0-560)/9999999999))+(ceil((0-580)/9999999999))+(ceil((0-900)/9999999999))+(ceil((0-930)/9999999999))+(ceil((0-960)/9999999999))+(ceil((0-990)/9999999999))+(ceil((0-1020)/9999999999))+(ceil((0-1050)/9999999999))+(ceil((0-1080)/9999999999))+(ceil((0-1110)/9999999999))+(ceil((0-1140)/9999999999))+(ceil((0-1170)/9999999999))+(ceil((0-1600)/9999999999))+(ceil((0-1640)/9999999999))+(ceil((0-1680)/9999999999))+(ceil((0-1720)/9999999999))+(ceil((0-1760)/9999999999))+(ceil((0-1800)/9999999999))+(ceil((0-1840)/9999999999))+(ceil((0-1880)/9999999999))+(ceil((0-1920)/9999999999))+(ceil((0-1960)/9999999999))+(ceil((0-2500)/9999999999))+(ceil((0-2550)/9999999999))+(ceil((0-2600)/9999999999))+(ceil((0-2650)/9999999999))+(ceil((0-2700)/9999999999))+(ceil((0-2750)/9999999999))+(ceil((0-2800)/9999999999))+(ceil((0-2850)/9999999999))+(ceil((0-2900)/9999999999))+(ceil((0-2950)/9999999999))+(ceil((0-3600)/9999999999))+(ceil((0-3660)/9999999999))+(ceil((0-3720)/9999999999))+(ceil((0-3780)/9999999999))+(ceil((0-3840)/9999999999))+(ceil((0-3900)/9999999999))+(ceil((0-3960)/9999999999))+(ceil((0-4020)/9999999999))+(ceil((0-4080)/9999999999))+(ceil((0-4140)/9999999999))+(ceil((0-4900)/9999999999))+(ceil((0-4970)/9999999999))+(ceil((0-5040)/9999999999))+(ceil((0-5110)/9999999999))+(ceil((0-5180)/9999999999))+(ceil((0-5250)/9999999999))+(ceil((0-5320)/9999999999))+(ceil((0-5390)/9999999999))+(ceil((0-5460)/9999999999))+(ceil((0-5530)/9999999999))+(ceil((0-6400)/9999999999))+(ceil((0-6480)/9999999999))+(ceil((0-6560)/9999999999))+(ceil((0-6640)/9999999999))+(ceil((0-6720)/9999999999))+(ceil((0-6800)/9999999999))+(ceil((0-6880)/9999999999))+(ceil((0-6960)/9999999999))+(ceil((0-7040)/9999999999))+(ceil((0-7120)/9999999999))+(ceil((0-8100)/9999999999))+(ceil((0-8190)/9999999999))+(ceil((0-8280)/9999999999))+(ceil((0-8370)/9999999999))+(ceil((0-8460)/9999999999))+(ceil((0-8550)/9999999999))+(ceil((0-8640)/9999999999))+(ceil((0-8730)/9999999999))+(ceil((0-8820)/9999999999))+(ceil((0-8910)/9999999999))+(ceil((0-10000)/9999999999))+(ceil((0-10100)/9999999999))+(ceil((0-10200)/9999999999))+(ceil((0-10300)/9999999999))+(ceil((0-10400)/9999999999))+(ceil((0-10500)/9999999999))+(ceil((0-10600)/9999999999))+(ceil((0-10700)/9999999999))+(ceil((0-10800)/9999999999))+(ceil((0-10900)/9999999999))+(ceil((0-12100)/9999999999))+(ceil((0-12210)/9999999999))+(ceil((0-12320)/9999999999))+(ceil((0-12430)/9999999999))+(ceil((0-12540)/9999999999))+(ceil((0-12650)/9999999999))+(ceil((0-12760)/9999999999))+(ceil((0-12870)/9999999999))+(ceil((0-12980)/9999999999))+(ceil((0-13090)/9999999999))+(ceil((0-14400)/9999999999))+(ceil((0-14520)/9999999999))+(ceil((0-14640)/9999999999))+(ceil((0-14760)/9999999999))+(ceil((0-14880)/9999999999))+(ceil((0-15000)/9999999999))+(ceil((0-15120)/9999999999))+(ceil((0-15240)/9999999999))+(ceil((0-15360)/9999999999))+(ceil((0-15480)/9999999999))+(ceil((0-16900)/9999999999))+(ceil((0-17030)/9999999999))+(ceil((0-17160)/9999999999))+(ceil((0-17290)/9999999999))+(ceil((0-17420)/9999999999))+(ceil((0-17550)/9999999999))+(ceil((0-17680)/9999999999))+(ceil((0-17810)/9999999999))+(ceil((0-17940)/9999999999))+(ceil((0-18070)/9999999999))+(ceil((0-19600)/9999999999))+(ceil((0-19740)/9999999999))+(ceil((0-19880)/9999999999))+(ceil((0-20020)/9999999999))+(ceil((0-20160)/9999999999))+(ceil((0-20300)/9999999999))+(ceil((0-20440)/9999999999))+(ceil((0-20580)/9999999999))+(ceil((0-20720)/9999999999))+(ceil((0-20860)/9999999999))+(ceil((0-22500)/9999999999))+(ceil((0-22650)/9999999999))+(ceil((0-22800)/9999999999))+(ceil((0-22950)/9999999999))+(ceil((0-23100)/9999999999))+(ceil((0-23250)/9999999999))+(ceil((0-23400)/9999999999))+(ceil((0-23550)/9999999999))+(ceil((0-23700)/9999999999))+(ceil((0-23850)/9999999999))+(ceil((0-25600)/9999999999))+(ceil((0-25760)/9999999999))+(ceil((0-25920)/9999999999))+(ceil((0-26080)/9999999999))+(ceil((0-26240)/9999999999))+(ceil((0-26400)/9999999999))+(ceil((0-26560)/9999999999))+(ceil((0-26720)/9999999999))+(ceil((0-26880)/9999999999))+(ceil((0-27040)/9999999999))+(ceil((0-28900)/9999999999))+(ceil((0-29070)/9999999999))+(ceil((0-29240)/9999999999))+(ceil((0-29410)/9999999999))+(ceil((0-29580)/9999999999))+(ceil((0-29750)/9999999999))+(ceil((0-29920)/9999999999))+(ceil((0-30090)/9999999999))+(ceil((0-30260)/9999999999))+(ceil((0-30430)/9999999999))+(ceil((0-32400)/9999999999))+(ceil((0-32580)/9999999999))+(ceil((0-32760)/9999999999))+(ceil((0-32940)/9999999999))+(ceil((0-33120)/9999999999))+(ceil((0-33300)/9999999999))+(ceil((0-33480)/9999999999))+(ceil((0-33660)/9999999999))+(ceil((0-33840)/9999999999))+(ceil((0-34020)/9999999999))+(ceil((0-36100)/9999999999))+(ceil((0-36290)/9999999999))+(ceil((0-36480)/9999999999))+(ceil((0-36670)/9999999999))+(ceil((0-36860)/9999999999))+(ceil((0-37050)/9999999999))+(ceil((0-37240)/9999999999))+(ceil((0-37430)/9999999999))+(ceil((0-37620)/9999999999))+(ceil((0-37810)/9999999999))+(ceil((0-40000)/9999999999))+(ceil((0-40200)/9999999999))+(ceil((0-40400)/9999999999))+(ceil((0-40600)/9999999999))+(ceil((0-40800)/9999999999))+(ceil((0-41000)/9999999999))+(ceil((0-41200)/9999999999))+(ceil((0-41400)/9999999999))+(ceil((0-41600)/9999999999))+(ceil((0-41800)/9999999999))+(ceil((0-44100)/9999999999))+(floor((0-3008500)/45000)))-9)/10)+1)*(100*((((10+(ceil((0-110)/9999999999))+(ceil((0-120)/9999999999))+(ceil((0-130)/9999999999))+(ceil((0-140)/9999999999))+(ceil((0-150)/9999999999))+(ceil((0-160)/9999999999))+(ceil((0-170)/9999999999))+(ceil((0-180)/9999999999))+(ceil((0-190)/9999999999))+(ceil((0-400)/9999999999))+(ceil((0-420)/9999999999))+(ceil((0-440)/9999999999))+(ceil((0-460)/9999999999))+(ceil((0-480)/9999999999))+(ceil((0-500)/9999999999))+(ceil((0-520)/9999999999))+(ceil((0-540)/9999999999))+(ceil((0-560)/9999999999))+(ceil((0-580)/9999999999))+(ceil((0-900)/9999999999))+(ceil((0-930)/9999999999))+(ceil((0-960)/9999999999))+(ceil((0-990)/9999999999))+(ceil((0-1020)/9999999999))+(ceil((0-1050)/9999999999))+(ceil((0-1080)/9999999999))+(ceil((0-1110)/9999999999))+(ceil((0-1140)/9999999999))+(ceil((0-1170)/9999999999))+(ceil((0-1600)/9999999999))+(ceil((0-1640)/9999999999))+(ceil((0-1680)/9999999999))+(ceil((0-1720)/9999999999))+(ceil((0-1760)/9999999999))+(ceil((0-1800)/9999999999))+(ceil((0-1840)/9999999999))+(ceil((0-1880)/9999999999))+(ceil((0-1920)/9999999999))+(ceil((0-1960)/9999999999))+(ceil((0-2500)/9999999999))+(ceil((0-2550)/9999999999))+(ceil((0-2600)/9999999999))+(ceil((0-2650)/9999999999))+(ceil((0-2700)/9999999999))+(ceil((0-2750)/9999999999))+(ceil((0-2800)/9999999999))+(ceil((0-2850)/9999999999))+(ceil((0-2900)/9999999999))+(ceil((0-2950)/9999999999))+(ceil((0-3600)/9999999999))+(ceil((0-3660)/9999999999))+(ceil((0-3720)/9999999999))+(ceil((0-3780)/9999999999))+(ceil((0-3840)/9999999999))+(ceil((0-3900)/9999999999))+(ceil((0-3960)/9999999999))+(ceil((0-4020)/9999999999))+(ceil((0-4080)/9999999999))+(ceil((0-4140)/9999999999))+(ceil((0-4900)/9999999999))+(ceil((0-4970)/9999999999))+(ceil((0-5040)/9999999999))+(ceil((0-5110)/9999999999))+(ceil((0-5180)/9999999999))+(ceil((0-5250)/9999999999))+(ceil((0-5320)/9999999999))+(ceil((0-5390)/9999999999))+(ceil((0-5460)/9999999999))+(ceil((0-5530)/9999999999))+(ceil((0-6400)/9999999999))+(ceil((0-6480)/9999999999))+(ceil((0-6560)/9999999999))+(ceil((0-6640)/9999999999))+(ceil((0-6720)/9999999999))+(ceil((0-6800)/9999999999))+(ceil((0-6880)/9999999999))+(ceil((0-6960)/9999999999))+(ceil((0-7040)/9999999999))+(ceil((0-7120)/9999999999))+(ceil((0-8100)/9999999999))+(ceil((0-8190)/9999999999))+(ceil((0-8280)/9999999999))+(ceil((0-8370)/9999999999))+(ceil((0-8460)/9999999999))+(ceil((0-8550)/9999999999))+(ceil((0-8640)/9999999999))+(ceil((0-8730)/9999999999))+(ceil((0-8820)/9999999999))+(ceil((0-8910)/9999999999))+(ceil((0-10000)/9999999999))+(ceil((0-10100)/9999999999))+(ceil((0-10200)/9999999999))+(ceil((0-10300)/9999999999))+(ceil((0-10400)/9999999999))+(ceil((0-10500)/9999999999))+(ceil((0-10600)/9999999999))+(ceil((0-10700)/9999999999))+(ceil((0-10800)/9999999999))+(ceil((0-10900)/9999999999))+(ceil((0-12100)/9999999999))+(ceil((0-12210)/9999999999))+(ceil((0-12320)/9999999999))+(ceil((0-12430)/9999999999))+(ceil((0-12540)/9999999999))+(ceil((0-12650)/9999999999))+(ceil((0-12760)/9999999999))+(ceil((0-12870)/9999999999))+(ceil((0-12980)/9999999999))+(ceil((0-13090)/9999999999))+(ceil((0-14400)/9999999999))+(ceil((0-14520)/9999999999))+(ceil((0-14640)/9999999999))+(ceil((0-14760)/9999999999))+(ceil((0-14880)/9999999999))+(ceil((0-15000)/9999999999))+(ceil((0-15120)/9999999999))+(ceil((0-15240)/9999999999))+(ceil((0-15360)/9999999999))+(ceil((0-15480)/9999999999))+(ceil((0-16900)/9999999999))+(ceil((0-17030)/9999999999))+(ceil((0-17160)/9999999999))+(ceil((0-17290)/9999999999))+(ceil((0-17420)/9999999999))+(ceil((0-17550)/9999999999))+(ceil((0-17680)/9999999999))+(ceil((0-17810)/9999999999))+(ceil((0-17940)/9999999999))+(ceil((0-18070)/9999999999))+(ceil((0-19600)/9999999999))+(ceil((0-19740)/9999999999))+(ceil((0-19880)/9999999999))+(ceil((0-20020)/9999999999))+(ceil((0-20160)/9999999999))+(ceil((0-20300)/9999999999))+(ceil((0-20440)/9999999999))+(ceil((0-20580)/9999999999))+(ceil((0-20720)/9999999999))+(ceil((0-20860)/9999999999))+(ceil((0-22500)/9999999999))+(ceil((0-22650)/9999999999))+(ceil((0-22800)/9999999999))+(ceil((0-22950)/9999999999))+(ceil((0-23100)/9999999999))+(ceil((0-23250)/9999999999))+(ceil((0-23400)/9999999999))+(ceil((0-23550)/9999999999))+(ceil((0-23700)/9999999999))+(ceil((0-23850)/9999999999))+(ceil((0-25600)/9999999999))+(ceil((0-25760)/9999999999))+(ceil((0-25920)/9999999999))+(ceil((0-26080)/9999999999))+(ceil((0-26240)/9999999999))+(ceil((0-26400)/9999999999))+(ceil((0-26560)/9999999999))+(ceil((0-26720)/9999999999))+(ceil((0-26880)/9999999999))+(ceil((0-27040)/9999999999))+(ceil((0-28900)/9999999999))+(ceil((0-29070)/9999999999))+(ceil((0-29240)/9999999999))+(ceil((0-29410)/9999999999))+(ceil((0-29580)/9999999999))+(ceil((0-29750)/9999999999))+(ceil((0-29920)/9999999999))+(ceil((0-30090)/9999999999))+(ceil((0-30260)/9999999999))+(ceil((0-30430)/9999999999))+(ceil((0-32400)/9999999999))+(ceil((0-32580)/9999999999))+(ceil((0-32760)/9999999999))+(ceil((0-32940)/9999999999))+(ceil((0-33120)/9999999999))+(ceil((0-33300)/9999999999))+(ceil((0-33480)/9999999999))+(ceil((0-33660)/9999999999))+(ceil((0-33840)/9999999999))+(ceil((0-34020)/9999999999))+(ceil((0-36100)/9999999999))+(ceil((0-36290)/9999999999))+(ceil((0-36480)/9999999999))+(ceil((0-36670)/9999999999))+(ceil((0-36860)/9999999999))+(ceil((0-37050)/9999999999))+(ceil((0-37240)/9999999999))+(ceil((0-37430)/9999999999))+(ceil((0-37620)/9999999999))+(ceil((0-37810)/9999999999))+(ceil((0-40000)/9999999999))+(ceil((0-40200)/9999999999))+(ceil((0-40400)/9999999999))+(ceil((0-40600)/9999999999))+(ceil((0-40800)/9999999999))+(ceil((0-41000)/9999999999))+(ceil((0-41200)/9999999999))+(ceil((0-41400)/9999999999))+(ceil((0-41600)/9999999999))+(ceil((0-41800)/9999999999))+(ceil((0-44100)/9999999999))+(floor((0-3008500)/45000)))-9)/10)+1)) (The 0s are @{xp}) When the formula is run from the chat window, it returns 3360. When the formula is run using... sendChat('roller','/roll ' + formula, function(result){
}); ... the api crashes.