UNPKG

muskytape

Version:

Framework não oficial do Discord.js

19 lines (14 loc) 403 B
const ArgumentType = require('./base'); class MessageArgumentType extends ArgumentType { constructor(client) { super(client, 'message'); } async validate(val, msg) { if(!/^[0-9]+$/.test(val)) return false; return Boolean(await msg.channel.messages.fetch(val).catch(() => null)); } parse(val, msg) { return msg.channel.messages.cache.get(val); } } module.exports = MessageArgumentType;