Feature/155 lobby command list #215

Merged
Vylpes merged 3 commits from feature/155-lobby-command-list into develop 2022-11-12 22:06:41 +00:00
Showing only changes of commit bd15d58195 - Show all commits

View file

@ -21,27 +21,27 @@ export default class ListLobby extends Command {
const channels: eLobby[] = [];
interaction.guild.channels.cache.forEach(async (channel) => {
for (let channel of interaction.guild.channels.cache.map(x => x)) {
const lobby = await eLobby.FetchOneByChannelId(channel.id);
if (lobby) {
channels.push(lobby);
}
});
}
const embed = new EmbedBuilder()
.setColor(EmbedColours.Ok)
.setTitle("Lobbies")
.setDescription(`Channels: ${channels.length}`);
channels.forEach(lobby => {
for (let lobby of channels) {
embed.addFields([
{
name: `<#${lobby.ChannelId}>`,
value: `Last Used: ${lobby.LastUsed}`
}
]);
});
}
await interaction.reply({ embeds: [ embed ]});
}