0

Simple Calculator for Sporks

Free lines JavaScript 2 revisions 47 23 days ago 22 days ago
discord-sporks
var arr = message.content.split(' ', 2);
if (arr[0] == '!calc') {
		if (arr[1].match(/^([-+/*]\d+(\.\d+)?)*/)) {
			create_message(CHANNEL_ID, arr[1] + " = " + eval(arr[1]));
        }
}

A simple calculator script for sporks, which will calculate simple maths, e.g. !calc 1+2