starboard: fix 'channel already has a starboard' error not resetting the setup state properly

This commit is contained in:
Dragory 2019-01-06 12:31:40 +02:00
parent dced441d09
commit 6dc8536da6

View file

@ -18,7 +18,7 @@ import { GuildSavedMessages } from "../data/GuildSavedMessages";
import { SavedMessage } from "../data/entities/SavedMessage";
export class StarboardPlugin extends ZeppelinPlugin {
public static pluginName = 'starboard';
public static pluginName = "starboard";
protected starboards: GuildStarboards;
protected savedMessages: GuildSavedMessages;
@ -81,6 +81,7 @@ export class StarboardPlugin extends ZeppelinPlugin {
const existingStarboard = await this.starboards.getStarboardByChannelId(starboardChannel.id);
if (existingStarboard) {
msg.channel.createMessage("That channel already has a starboard. Try again?");
starboardChannel = null;
continue;
}
} while (starboardChannel == null);