blob: a85351864941a4ad30e8ab58338a4fe6b83d77c6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
/*
*/
'use strict';
exports.run = async (core, server, socket, data) => {
if (socket.uType != 'admin') {
// ignore if not admin
return;
}
let channels = {};
for (var client of server.clients) {
if (client.channel) {
if (!channels[client.channel]) {
channels[client.channel] = [];
}
channels[client.channel].push(client.nick);
}
}
let lines = [];
for (let channel in channels) {
lines.push(`?${channel} ${channels[channel].join(", ")}`);
}
let text = '';
text += lines.join("\n");
server.reply({
cmd: 'info',
text: text
}, socket);
};
exports.info = {
name: 'listusers',
usage: 'listusers',
description: 'Outputs all current channels and sockets in those channels'
};
|