โ† ะะฐะทะฐะด
""" AlphaPulse Bot โ€” Configuration & Constants """ import os from telegram import InlineKeyboardButton, InlineKeyboardMarkup # โ”€โ”€โ”€ Main Config โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ CONFIG = { 'bot_token': os.environ.get('TELEGRAM_BOT_TOKEN', ''), 'channel_id': '@alphapulsexp', 'openrouter_key': os.environ.get('OPENROUTER_API_KEY', ''), 'posting_schedule': [2, 8, 11, 13, 15, 18, 21, 23], # Vancouver hours (13 & 23 = extra news slots) 'enable_polls': True, 'poll_frequency': 4, # every Nth post is a poll 'retention_days': 30, 'health_port': 8090, 'affiliate_binance': os.environ.get( 'BINANCE_AFFILIATE_LINK', 'https://www.binance.com/referral/earn-together/refer2earn-usdc/claim?ref=GRO_28502_B62SR' ), } AI_RETRY_COUNT = 3 AI_RETRY_DELAY = 5 # seconds between retries # โ”€โ”€โ”€ Affiliate Links (rotated in posts) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ AFFILIATE_LINKS = [ { 'name': 'Binance', 'url': CONFIG['affiliate_binance'], 'cta': '๐Ÿ’ผ Trade on Binance', 'weight': 0.5, }, { 'name': 'Bybit', 'url': os.environ.get('BYBIT_AFFILIATE_LINK', 'https://www.bybit.com/'), 'cta': '๐Ÿ’ผ Trade on Bybit', 'weight': 0.3, }, { 'name': 'OKX', 'url': os.environ.get('OKX_AFFILIATE_LINK', 'https://www.okx.com/'), 'cta': '๐Ÿ’ผ Trade on OKX', 'weight': 0.2, }, ] # โ”€โ”€โ”€ Premium Teasers (shown randomly after data posts) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ PREMIUM_TEASERS = [ "๐Ÿ”’ Want real-time alerts? Premium coming soon โ†’ @alphapulsexp", "๐Ÿ”’ Premium: whale alerts, early signals, no noise โ†’ soon", "๐Ÿ”’ Funding spike detected โ€” premium members get alerts instantly", "๐Ÿ“Š Full analysis with entry/exit levels โ€” coming to Premium", "โšก Premium members see this data 30 min earlier", ] # How often to show affiliate (1 = every post, 3 = every 3rd) AFFILIATE_FREQUENCY = 3 # How often to show premium teaser (1 in N data posts) PREMIUM_TEASER_FREQUENCY = 5 # โ”€โ”€โ”€ RSS Sources (9 total) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ RSS_SOURCES = { 'CoinDesk': 'https://www.coindesk.com/arc/outboundfeeds/rss/', 'Cointelegraph': 'https://cointelegraph.com/rss', 'Decrypt': 'https://decrypt.co/feed', 'BeInCrypto': 'https://beincrypto.com/feed/', 'BitcoinMag': 'https://bitcoinmagazine.com/.rss/full/', 'TheDefiant': 'https://thedefiant.io/feed', 'CryptoSlate': 'https://cryptoslate.com/feed/', 'Blockworks': 'https://blockworks.co/feed', 'TheBlock': 'https://www.theblock.co/rss.xml', } # โ”€โ”€โ”€ Post format weights (8 formats) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ POST_FORMATS = { 'hot': 0.15, 'analysis': 0.20, 'sarcasm': 0.15, 'facts': 0.20, 'signal': 0.10, 'thread': 0.10, 'hot_take': 0.05, 'deep_dive': 0.05, } # โ”€โ”€โ”€ Time-based themes โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ TIME_THEMES = { 2: {'emoji': '๐ŸŒ…', 'theme': 'Early Morning'}, 8: {'emoji': 'โ˜•', 'theme': 'Morning Digest'}, 11: {'emoji': 'โ˜€๏ธ', 'theme': 'Midday Update'}, 13: {'emoji': '๐Ÿ””', 'theme': 'Afternoon News'}, 15: {'emoji': '๐Ÿ“Š', 'theme': 'Afternoon Digest'}, 18: {'emoji': '๐ŸŒ†', 'theme': 'Evening Update'}, 21: {'emoji': '๐ŸŒ™', 'theme': 'Night Wrap'}, 23: {'emoji': '๐Ÿฆ‰', 'theme': 'Late Night'}, } BASE_HASHTAGS = '#crypto #bitcoin #altcoins #BTC #trading #cryptonews' # โ”€โ”€โ”€ Inline keyboard for news posts โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ QUICK_ACTIONS_KEYBOARD = InlineKeyboardMarkup([[ InlineKeyboardButton("๐Ÿ“Š Price", callback_data="cb_price"), InlineKeyboardButton("๐Ÿ˜ฑ Fear", callback_data="cb_fear"), InlineKeyboardButton("๐Ÿ”ฅ Trending", callback_data="cb_trending"), ]]) # โ”€โ”€โ”€ Smart hashtag keywords โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ TOPIC_TAGS = { 'defi': '#DeFi', 'decentralized finance': '#DeFi', 'nft': '#NFT', 'layer 2': '#Layer2', 'layer2': '#Layer2', 'l2': '#Layer2', 'ethereum': '#ETH', 'solana': '#SOL', 'binance': '#BNB', 'xrp': '#XRP', 'ripple': '#XRP', 'cardano': '#ADA', 'regulation': '#Regulation', 'sec': '#SEC', 'etf': '#ETF', 'hack': '#SecurityAlert', 'exploit': '#SecurityAlert', 'breach': '#SecurityAlert', 'airdrop': '#Airdrop', 'staking': '#Staking', 'halving': '#Halving', 'mining': '#Mining', 'ai': '#AI', 'artificial intelligence': '#AI', 'stablecoin': '#Stablecoin', 'cbdc': '#CBDC', 'web3': '#Web3', 'metaverse': '#Metaverse', } # โ”€โ”€โ”€ Known tickers โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ KNOWN_TICKERS = { 'btc', 'eth', 'sol', 'bnb', 'xrp', 'ada', 'dot', 'avax', 'matic', 'link', 'uni', 'atom', 'ltc', 'doge', 'shib', 'trx', 'near', 'algo', 'xlm', 'icp', 'apt', 'arb', 'op', 'sui', 'sei', 'inj', 'ton', 'pepe', 'wld', 'rndr', } # โ”€โ”€โ”€ News type auto-detection โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ NEWS_TYPE_SIGNALS = { 'hot': [ 'breaking', 'hack', 'exploit', 'breach', 'crash', 'surge', 'soars', 'plunges', 'collapses', 'emergency', 'alert', 'warning', 'ban', 'arrested', 'shutdown', 'halted', ], 'analysis': [ 'etf', 'regulation', 'sec', 'federal', 'macro', 'inflation', 'interest rate', 'institutional', 'adoption', 'partnership', 'upgrade', 'hard fork', 'roadmap', 'report', 'research', ], 'signal': [ 'price target', 'bullish', 'bearish', 'support', 'resistance', 'all-time high', 'ath', 'bottom', 'top', 'rally', 'correction', 'dip', 'pump', 'dump', 'prediction', 'forecast', ], 'sarcasm': [ 'meme', 'rug', 'scam', 'celebrity', 'influencer', 'moon', 'lambo', 'laser eyes', 'diamond hands', 'paper hands', ], 'thread': [ 'everything you need to know', 'explained', 'breakdown', 'guide', 'how to', 'what is', 'reasons why', 'things to know', ], }