From 097a78c1e0994b8db65d22e602ee242dc8bbc01b Mon Sep 17 00:00:00 2001 From: Vladimir Babin Date: Thu, 14 Mar 2024 23:49:51 +0300 Subject: [PATCH] Prevent create new collection if already exists --- .env.example | 1 + src/bot/features/collection.ts | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.env.example b/.env.example index 8371254..02a066f 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,5 @@ NODE_ENV=development +BOT_MODE=polling LOG_LEVEL=debug BOT_TOKEN=123:ABCABCD MONGO=mongodb://localhost:27017/nft-bot?retryWrites=true&w=majority diff --git a/src/bot/features/collection.ts b/src/bot/features/collection.ts index 44de5b3..72e3396 100644 --- a/src/bot/features/collection.ts +++ b/src/bot/features/collection.ts @@ -16,6 +16,9 @@ feature.command( logHandle("command-collection"), chatAction("upload_document"), async (ctx) => { + if (config.COLLECTION_ADDRESS) { + return ctx.reply("Collection already deployed!"); + } const wallet = await openWallet(config.MNEMONICS!.split(" ")); const collectionData = { ownerAddress: wallet.contract.address,