correctif userinfo

This commit is contained in:
VALOU3336
2024-02-16 17:11:05 +01:00
parent 5d5a0a508b
commit 3e0ecf1b4e
2 changed files with 9 additions and 4 deletions
+8 -3
View File
@@ -8,12 +8,17 @@ module.exports = {
async execute(message, args, client) {
let user;
if (args.length > 0) {
const userId = args[0];
user = message.guild.members.cache.get(userId)?.user;
if (args.length > 0) {
const userId = args[0].match(/(\d+)/);
if (userId && userId[1]) {
user = message.guild.members.cache.get(userId[1])?.user;
}
} else {
user = message.mentions.users.first() || message.author;
}
if (!user) {
return message.reply('Utilisateur introuvable.');
}
const member = message.guild.members.cache.get(user.id);
if (!user) {
return message.reply('Utilisateur introuvable.');
+1 -1
View File
@@ -10,7 +10,7 @@
"type": "git",
"url": "git+https://github.com/Tutur33/gestion.git"
},
"author": "Tutur33",
"author": "Valou336 && Tutur33 ",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/Tutur33/gestion/issues"