mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-19 13:56:43 +02:00
Fix message type
This commit is contained in:
@@ -7,7 +7,7 @@ module.exports = class MessageArgumentType extends ArgumentType {
|
|||||||
|
|
||||||
async validate(val, msg) {
|
async validate(val, msg) {
|
||||||
if (!/^[0-9]+$/.test(val)) return false;
|
if (!/^[0-9]+$/.test(val)) return false;
|
||||||
return Boolean(await msg.channel.messages.fetch({ message: val }).catch(() => null));
|
return Boolean(await msg.channel.messages.fetch(val).catch(() => null));
|
||||||
}
|
}
|
||||||
|
|
||||||
parse(val, msg) {
|
parse(val, msg) {
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ module.exports = class UserArgumentType extends ArgumentType {
|
|||||||
const user = await msg.client.users.fetch(matches[1]);
|
const user = await msg.client.users.fetch(matches[1]);
|
||||||
if (!user) return false;
|
if (!user) return false;
|
||||||
return true;
|
return true;
|
||||||
} catch {
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user