/[sudobot]/trunk/src/UserInput.js
ViewVC logotype

Contents of /trunk/src/UserInput.js

Parent Directory Parent Directory | Revision Log Revision Log


Revision 49 - (show annotations)
Mon Jul 29 17:28:21 2024 UTC (8 months ago) by rakin
File MIME type: text/javascript
File size: 526 byte(s)
Release version 1.10.0

* Added -queues command to list all queued jobs
* Added -joke command to fetch random jokes
* Added support of user tags in some user-based commands
1 const { Collection } = require('discord.js');
2
3 async function getUser(input, { guild, mentions = { members: new Collection() } }, member = true) {
4 if (await mentions[member ? "members" : 'users'].first()) {
5 return await mentions[member ? "members" : 'users'].first();
6 }
7
8 if (input.indexOf('#') !== -1) {
9 return await guild[member ? "members" : 'users'].cache.find(m => m.user.tag === input);
10 }
11
12 return await guild[member ? "members" : 'users'].fetch(input);
13 }
14
15 module.exports = { getUser };

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26