-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.js
More file actions
46 lines (35 loc) · 1.47 KB
/
Copy pathfunctions.js
File metadata and controls
46 lines (35 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
module.exports={
getMember: function(message,toFind = ''){
toFind = toFind.toLowerCase();
let target = message.guild.members.cache.get(toFind);
if(!target && message.mentions.members)
target= message.mentions.members.first();
if(!target && toFind){
target = message.guild.members.find(member =>{
return member.displayName.toLowerCase().includes(toFind) ||
member.user.tag.toLowerCase().includes(toFind)
});
}
if(!target)
target = message.member;
return target;
},
formatDate: function(date){
return Intl.DateTimeFormat('tr-TR').format(date);
},
promptMessage: async function(message,author, timer , validReactions){
timer*=1000;
for (const reaction of validReactions) await message.react(reaction)
const filter = (reaction,user) => validReactions.includes(reaction.emoji.name) && user.id === author.id;
return message
.awaitReactions(filter, { max: 1, time: timer, errors: ['time'] })
.then(collected => {
const reaction = collected.first();
return reaction.emoji.name;
})
.catch(collected => {
message.reply('Çok fazla bekletildim. Malesef atamıyorum!');
});
//collected.first() && collected.first().emoji.name);
}
}