mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36: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) {
|
||||
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) {
|
||||
|
||||
@@ -12,7 +12,8 @@ module.exports = class UserArgumentType extends ArgumentType {
|
||||
const user = await msg.client.users.fetch(matches[1]);
|
||||
if (!user) return false;
|
||||
return true;
|
||||
} catch {
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user