mirror of
https://github.com/arthur-pbty/gestion.git
synced 2026-06-07 06:45:18 +02:00
correctif userinfo
This commit is contained in:
@@ -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.');
|
||||
|
||||
Reference in New Issue
Block a user