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[] = []; 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); const lobby = await eLobby.FetchOneByChannelId(channel.id);
if (lobby) { if (lobby) {
channels.push(lobby); channels.push(lobby);
} }
}); }
const embed = new EmbedBuilder() const embed = new EmbedBuilder()
.setColor(EmbedColours.Ok) .setColor(EmbedColours.Ok)
.setTitle("Lobbies") .setTitle("Lobbies")
.setDescription(`Channels: ${channels.length}`); .setDescription(`Channels: ${channels.length}`);
channels.forEach(lobby => { for (let lobby of channels) {
embed.addFields([ embed.addFields([
{ {
name: `<#${lobby.ChannelId}>`, name: `<#${lobby.ChannelId}>`,
value: `Last Used: ${lobby.LastUsed}` value: `Last Used: ${lobby.LastUsed}`
} }
]); ]);
}); }
await interaction.reply({ embeds: [ embed ]}); await interaction.reply({ embeds: [ embed ]});
} }