2022-06-19 00:25:21 +00:00
|
|
|
import {PluginInputHandler} from "./index";
|
2016-10-27 05:59:36 +00:00
|
|
|
|
2022-06-19 00:25:21 +00:00
|
|
|
const commands = ["whois"];
|
2016-10-27 05:59:36 +00:00
|
|
|
|
2022-06-19 00:25:21 +00:00
|
|
|
const input: PluginInputHandler = function ({irc}, chan, cmd, args) {
|
2016-10-27 05:59:36 +00:00
|
|
|
if (args.length === 1) {
|
|
|
|
// This queries server of the other user and not of the current user, which
|
|
|
|
// does not know idle time.
|
|
|
|
// See http://superuser.com/a/272069/208074.
|
2017-11-22 06:39:32 +00:00
|
|
|
irc.raw("WHOIS", args[0], args[0]);
|
2016-10-27 05:59:36 +00:00
|
|
|
} else {
|
|
|
|
// Re-assembling the command parsed in client.js
|
2017-11-22 06:39:32 +00:00
|
|
|
irc.raw(`${cmd} ${args.join(" ")}`);
|
2016-10-27 05:59:36 +00:00
|
|
|
}
|
|
|
|
};
|
2022-06-19 00:25:21 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
commands,
|
|
|
|
input,
|
|
|
|
};
|