mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-23 18:05:01 +02:00
React if able in DM
This commit is contained in:
+5
-2
@@ -183,8 +183,11 @@ module.exports = class Util {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static async reactIfAble(msg, user, emoji, fallbackEmoji) {
|
static async reactIfAble(msg, user, emoji, fallbackEmoji) {
|
||||||
if (fallbackEmoji && !msg.channel.permissionsFor(user).has('USE_EXTERNAL_EMOJIS')) emoji = fallbackEmoji;
|
const dm = !msg.guild;
|
||||||
if (msg.channel.permissionsFor(user).has(['ADD_REACTIONS', 'READ_MESSAGE_HISTORY'])) {
|
if (fallbackEmoji && (!dm && !msg.channel.permissionsFor(user).has('USE_EXTERNAL_EMOJIS'))) {
|
||||||
|
emoji = fallbackEmoji;
|
||||||
|
}
|
||||||
|
if (dm || msg.channel.permissionsFor(user).has(['ADD_REACTIONS', 'READ_MESSAGE_HISTORY'])) {
|
||||||
try {
|
try {
|
||||||
await msg.react(emoji);
|
await msg.react(emoji);
|
||||||
} catch {
|
} catch {
|
||||||
|
|||||||
Reference in New Issue
Block a user