const Discord = require('discord.js');
const client = new Discord.Client();

function botLog(msg) {
    console.log(`Bot: ${msg}`)
}

function userLog(nick, msg) {
    console.log(`User ${nick}: ${msg}`);
}

client.on('ready', () => {
	botLog('Ready!');
	client.user.setGame('służę pomocą!');
	client.user.setAvatar('./avatar3.png');
});

client.on('message', message => {
	if(message.author.bot) return;

    let command = message.content.toLowerCase();
    let nick = message.author.username;
    let channel = message.channel;
    switch (command) {
        case '.ping':
            userLog(nick, 'command PING');
            message.reply('pong!');
            break;
        case '.pong':
            userLog(nick, 'command PONG');
            message.reply('ping!');
            break;
        case 'hi kuvu!':
            userLog(nick, 'command HI_KUVU');
            channel.sendMessage('Hi ' + message.author.username + '!');
            break;
        case '#reklama':
            userLog(nick, 'command REKLAMA');
            message.delete();
            channel.sendMessage('Zapraszam do zapoznania się z innymi projektami mojego stwórcy!\nStrona www: https://kuvus.pl');
            break;
        case '.pomoc':
        case '.help':
            userLog(nick, 'command HELP');
            message.author.sendMessage('Oto lista komend:\n```.pomoc - wyświetla pomoc\n.ping - wysyła wiadomość o treści ping\n.avatar - wysyła adres URL do twojego avatara\n.servers - Lista serwerów używających kuvuBota```');
            message.reply('lista komend została wysłana na PW!');
            break;
        case '.servers':
            userLog(nick, 'command SERVERS');
            message.reply('serwery, które używają kuvuBota: \n' + '```' + client.guilds.map(r => '\n' + r.name + ' (#' + r.id + ')') + '```');
        default:
            if (command.startsWith('.avatar')) {
                userLog(nick, 'command AVATAR');
                let args = message.content.split(" ", 2);
                let cmd = args[0];
                let ment = args[1];
                if (ment === undefined) {
                    message.reply(message.author.avatarURL);
                }
                else {
                    message.reply(ment.avatarURL);
                }
            }
    }
});

client.login('<TOKEN>');

@@ -1948,19 +1948,20 @@
     let 
-arg
+user
 s = mess
@@ -1968,66 +1968,65 @@
 age.
-content.split(%22 %22, 2);%0A                let cmd = args%5B0%5D;%0A
+mentions.users;%0A                if (users.first()) %7B%0A    
     
@@ -2045,22 +2045,19 @@
 let 
-ment = args%5B1%5D
+result = ''
 ;%0A  
@@ -2074,81 +2074,81 @@
     
-if (ment === undefined) %7B%0A                    message.reply(message.autho
+    users.forEach(function (user) %7B%0A                        result += use
 r.av
@@ -2146,33 +2146,39 @@
 = user.avatarURL
-)
+ + '%5Cn'
 ;%0A              
@@ -2171,34 +2171,42 @@
                 
-%7D%0A
+    %7D);%0A  
                 
@@ -2204,16 +2204,59 @@
         
+   message.reply(result);%0A                %7D
  else %7B%0A
@@ -2291,18 +2291,28 @@
 reply(me
-nt
+ssage.author
 .avatarU

Fix getting other users avatars