Updated Mastodon actually have correct finnish verb. Allowed dice throws to have text after the command.

master
lanxu 2019-03-12 21:29:01 +02:00
parent 27a58c4522
commit e3f9491dcc
2 changed files with 4 additions and 4 deletions

View File

@ -11,7 +11,7 @@ class Dice extends BasePlugin {
test(input) {
var res = null;
if (res = input.match(/^\.heit(a|ä) ([0-9]+)d([0-9]+)$/i)) {
if (res = input.match(/^\.heit(a|ä) ([0-9]+)d([0-9]+)( ([ \w])*)*$/i)) {
return true;
}
if (res = input.match(/^\.heit(a|ä) voltti homo$/i)) {
@ -54,7 +54,7 @@ class Dice extends BasePlugin {
result(input) {
// Different cases
let res = null
if (res = input.match(/^\.heit(a|ä) ([0-9]+)d([0-9]+)$/i)) {
if (res = input.match(/^\.heit(a|ä) ([0-9]+)d([0-9]+)( ([ \w])*)*$/i)) {
var th = this.getDiceString(res[2], res[3]);
return 'Heitettiin: '+th;
}

View File

@ -71,9 +71,9 @@ class Mastodon extends BasePlugin {
if (host !== null && tootId !== null) {
that.getToot(host, tootId).then(function(toot) {
resultResolve('Töötti: ' + toot);
resultResolve('Tuuttaus: ' + toot);
}, function(error) {
resultReject('Töötti: Jokin virhe tapahtui');
resultReject('Tuuttaus: Jokin virhe tapahtui');
});
}
});