Feature/155 lobby command list #215
1 changed files with 4 additions and 4 deletions
|
@ -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 ]});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue