mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Fix reactIfAble
This commit is contained in:
+2
-1
@@ -283,6 +283,7 @@ module.exports = class Util {
|
|||||||
|
|
||||||
static async reactIfAble(msg, user, emoji, fallbackEmoji) {
|
static async reactIfAble(msg, user, emoji, fallbackEmoji) {
|
||||||
const dm = !msg.guild;
|
const dm = !msg.guild;
|
||||||
|
if (!emoji) emoji = fallbackEmoji;
|
||||||
if (fallbackEmoji && (!dm && !msg.channel.permissionsFor(user).has('USE_EXTERNAL_EMOJIS'))) {
|
if (fallbackEmoji && (!dm && !msg.channel.permissionsFor(user).has('USE_EXTERNAL_EMOJIS'))) {
|
||||||
emoji = fallbackEmoji;
|
emoji = fallbackEmoji;
|
||||||
}
|
}
|
||||||
@@ -326,7 +327,7 @@ module.exports = class Util {
|
|||||||
if (!num) return false;
|
if (!num) return false;
|
||||||
return num > 0 && num <= arr.length;
|
return num > 0 && num <= arr.length;
|
||||||
};
|
};
|
||||||
const msgs = await msg.channel.awaitMessages({ filter, max: 1, time });
|
const msgs = await msg.channel.awaitMessages({ filter,max: 1, time });
|
||||||
if (!msgs.size) return defalt;
|
if (!msgs.size) return defalt;
|
||||||
return arr[Number.parseInt(msgs.first().content, 10) - 1];
|
return arr[Number.parseInt(msgs.first().content, 10) - 1];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user