mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +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) {
|
||||
if (fallbackEmoji && !msg.channel.permissionsFor(user).has('USE_EXTERNAL_EMOJIS')) emoji = fallbackEmoji;
|
||||
if (msg.channel.permissionsFor(user).has(['ADD_REACTIONS', 'READ_MESSAGE_HISTORY'])) {
|
||||
const dm = !msg.guild;
|
||||
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 {
|
||||
await msg.react(emoji);
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user