From d15b80d343bde5ded34da5fafec0382fff3a8513 Mon Sep 17 00:00:00 2001 From: klimoza Date: Wed, 20 Jul 2022 18:27:29 +0300 Subject: [PATCH] Micro fixes --- listener.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/listener.py b/listener.py index 7cfd189..6ad7a76 100755 --- a/listener.py +++ b/listener.py @@ -226,8 +226,8 @@ def help(message): "All available commands:\n" "/get_feed network period: Display feed for a given period \n" # "network = mainnet | testnet\nperiod = 1m | 5m | 15m | 30m | 1h | 6h | 12h | 1d\n" - "/notify_on: Turn on notifications for newcomer mints\n" - "/notify_off: Turn off notifications for newcomer mints\n" + "/notify_on network: Turn on notifications for newcomer mints\n" + "/notify_off network: Turn off notifications for newcomer mints\n" "/help: Display help", parse_mode="HTML", ) @@ -347,6 +347,8 @@ def get_feed(message): msg = "" for (collection, value) in feed: msg += f"Collection: {collection}\nMints: {value}\n================\n" + if len(feed) == 0: + msg = "No NFT's were minted." bot.send_message(message.chat.id, msg) @@ -409,10 +411,15 @@ def get_new_transactions(net): new_max_time = 0 mints = cur.fetchall() + print(len(mints)) + receipts = set() for (id, time, contract, owner_id, _, args) in mints: new_max_time = max(new_max_time, time) if not check_args(args): continue + if id in receipts: + continue + receipts.add(id) (collection, title, description, media) = get_metadata(args, contract) msg = f"NFT MINTED!\n{owner_id} just minted NFT from {collection} collection on {net}"