const discordLink = "https://discord.gg/UmbU38vg2r";
const yt = "https://www.youtube.com/playlist?list=PLsfbFAUBgEYSVqNEwaQrsMjap9S9v641J";

PlayerEvents.loggedIn(event => {
    event.player.tell(Text.green("Hey, thanks for playing my pack! ~ Annoy"));
    event.player.tell(
        Text.blue("If you need help, join our discord")
            .underlined(true)
            .clickOpenUrl(discordLink)
    );
    event.player.tell(
        Text.red("Video guides for the pack")
            .underlined(true)
            .clickOpenUrl(yt)
    );
    event.player.tell(
        Text.gray("> Use ")
            .append(Text.gold("/guide"))
            .append(Text.gray(" for essential info!"))
    );
    event.player.tell(
        Text.gray("> Rarely, specific seeds break tower generation, if 2 towers spawn on each other, make a new world :)")
    );
    event.player.tell(
        Text.gray("> Always backup worlds to desktop before updating the modpack. Use /backup to see how")
    );
});

ServerEvents.commandRegistry(event => {
  const { commands: Commands } = event;

  event.register(
    Commands.literal("discord")
      .executes(ctx => {
        ctx.source.player.tell(
            Text.blue("Click here to join the discord!")
                .underlined(true)
                .clickOpenUrl(discordLink)
        );
        return 1;
      })
  );
});
