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) { async execute(message, args, client) {
let user; let user;
if (args.length > 0) { if (args.length > 0) {
const userId = args[0]; const userId = args[0].match(/(\d+)/);
user = message.guild.members.cache.get(userId)?.user; if (userId && userId[1]) {
user = message.guild.members.cache.get(userId[1])?.user;
}
} else { } else {
user = message.mentions.users.first() || message.author; user = message.mentions.users.first() || message.author;
} }
if (!user) {
return message.reply('Utilisateur introuvable.');
}
const member = message.guild.members.cache.get(user.id); const member = message.guild.members.cache.get(user.id);
if (!user) { if (!user) {
return message.reply('Utilisateur introuvable.'); return message.reply('Utilisateur introuvable.');
+1 -1
View File
@@ -10,7 +10,7 @@
"type": "git", "type": "git",
"url": "git+https://github.com/Tutur33/gestion.git" "url": "git+https://github.com/Tutur33/gestion.git"
}, },
"author": "Tutur33", "author": "Valou336 && Tutur33 ",
"license": "Apache-2.0", "license": "Apache-2.0",
"bugs": { "bugs": {
"url": "https://github.com/Tutur33/gestion/issues" "url": "https://github.com/Tutur33/gestion/issues"