def edit_book(self, pages):
        book = self._setup_book()
        if book is None:
            return False
        nbtpages = nbt.TagList(nbt.TagString)
        for i, page in enumerate(pages):
            if i >= constants.BOOK_MAXPAGES:
                break
            nbtpages.insert(i, nbt.TagString(page))
        book.nbt["pages"] = nbtpages
        self.channels.send("MC|BEdit", self._pack_book(book))
Set the pages of current book in hand
dataset/ETHPy150Open SpockBotMC/SpockBot/spockbot/plugins/helpers/interact.py/InteractPlugin.edit_book