k44Eqha/commands.js

21 lines
703 B
JavaScript
Raw Permalink Normal View History

2022-01-04 07:45:28 +01:00
global.commands = [
{
name: "list",
description: "Show the members on the other side of an MPP bridge",
exec: i => {
let bridge = bridges.find(x => x.channel == i.channel.id);
if (!bridge) return i.reply({ephemeral: true, content: "Not available in this channel"});
let ppl_list = Object.values(bridge.client.ppl).map(m => `\`${m._id}\` ${m.name}`);
i.reply({content: `__**${ppl_list.length} people are playing**__\n${ppl_list.join("\n")}`});
}
}
];
2022-01-04 08:00:36 +01:00
dClient.on("interactionCreate", interaction => {
2022-01-04 07:45:28 +01:00
commands.find(x => x.name == interaction.commandName)?.exec?.(interaction);
});
2022-01-04 08:00:36 +01:00
dClient.once("ready", () => {
dClient.guilds.resolve(config.guildID)?.commands.set(commands);
2022-01-04 07:45:28 +01:00
});