-
-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathfunctions.js
More file actions
17 lines (17 loc) · 594 Bytes
/
functions.js
File metadata and controls
17 lines (17 loc) · 594 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module.exports = {
match: function(msg, i) {
if (!msg) return undefined;
if (!i) return undefined;
let user = i.members.cache.find(
m =>
m.user.username.toLowerCase().startsWith(msg) ||
m.user.username.toLowerCase() === msg ||
m.user.username.toLowerCase().includes(msg) ||
m.displayName.toLowerCase().startsWith(msg) ||
m.displayName.toLowerCase() === msg ||
m.displayName.toLowerCase().includes(msg)
);
if (!user) return undefined;
return user.user;
}
};