Change lobby command to error upon making a duplicate lobby channel (#154)

This commit is contained in:
Vylpes 2022-05-10 18:15:40 +01:00 committed by GitHub
parent 31866b1c3b
commit b4cec6778d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View file

@ -116,6 +116,15 @@ export default class Lobby extends Command {
return;
}
const lobby = await eLobby.FetchOneByChannelId(channel.id);
if (lobby) {
const errorEmbed = new ErrorEmbed(context, "This channel has already been setup.");
errorEmbed.SendToCurrentChannel();
return;
}
const entity = new eLobby(channel.id, role.id, cooldown, gameName);
await entity.Save(eLobby, entity);