Comparing version 0.0.8-beta to 0.0.9-beta
@@ -11,7 +11,18 @@ const { Message } = require("discord.js"); | ||
module.exports = (message, action) => { | ||
const replyRegex = /reply\[message="(.+)"\]/; | ||
if (action.match(replyRegex)) { | ||
const match = action.match(replyRegex); | ||
message.reply(match[1]) | ||
const ActionRegex = /([A-Za-z0-9]+)\[[A-Za-z0-9]+="(.+)"\]/; | ||
const match = action.match(ActionRegex); | ||
const functions = { | ||
reply: (msgToReply) => { | ||
message.reply(msgToReply) | ||
}, | ||
send: (msgToSend) => { | ||
message.channel.send(msgToSend) | ||
} | ||
} | ||
if (match) { | ||
console.log(match); | ||
if (match[1] in functions) | ||
functions[match[1]](match[2]); | ||
} | ||
} |
{ | ||
"name": "disceasy", | ||
"version": "0.0.8-beta", | ||
"version": "0.0.9-beta", | ||
"description": "Um pacote simples para produzir bots Discord sem complicação.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
3811
85