PROJECT DOCUMENT Discord Bot for Multi-Brand Clipping Campaign Management 1. Project Overview We need a Discord bot to manage and track multiple brand clipping campaigns simultaneously. Clippers will submit promotional logo videos posted on: Instagram TikTok YouTube X (Twitter) The bot must: Track views automatically every 3 hours Calculate earnings based on configurable CPM Support multiple active campaigns at once Provide leaderboards and stats Export campaign reports to Excel Store USDT wallet addresses (manual payout only) Expected volume: 8,000–10,000 submissions per month Database: SQLite 2. Campaign System The bot must support multiple campaigns running at the same time (different brands). Campaign Fields Each campaign must include: Campaign Name Brand Name Start Date End Date Budget (USD) Minimum Views Required CPM per platform: Instagram CPM TikTok CPM YouTube CPM X CPM Status: Active Ended Paid Rejected 3. Submission System Slash Command /submit Required Inputs Campaign Platform (IG / TikTok / YouTube / X) Post URL Submission Rules One video URL can only be submitted to ONE campaign. If duplicate URL is submitted → reject with message: “Duplicate content already submitted.” Generate a unique submission ID: Example: SUB-000001 Stored Data Per Submission Submission ID Discord Username Discord User ID Campaign Platform URL Date Submitted Views (auto tracked) Likes (if possible) Earnings (calculated dynamically) Status 4. Automatic View Tracking Views must be tracked automatically every 3 hours No API keys will be provided Developer must implement API or scraping solution Must support: Instagram TikTok YouTube X Failure Handling If tracking fails → retry automatically If retry fails → notify Admin Must handle rate limits properly 5. Earnings Calculation Earnings formula: Earnings = (Views / 1000) × Platform CPM CPM configurable per campaign and per platform Currency: USD Round to 2 decimal places Earnings update dynamically as views update 6. Minimum Views Requirement Minimum views set during campaign creation Submission must reach minimum views to qualify for payout 7. Clipper Commands The following slash commands must be available to clippers: /submit /myclips /mystats /leaderboard /campaigns /earnings /add-usdt <wallet_address> Command Behavior /myclips Shows: Submission ID Campaign Views Earnings Status /mystats Shows: Total views Total earnings Active campaigns /leaderboard Top 10 ranked by Views or Earnings Admin configurable ranking method /campaigns Lists all active campaigns. /earnings Shows: Pending earnings Eligible earnings Paid earnings 8. USDT Wallet Collection (Manual Payout Only) The bot does NOT need to track blockchain payments. It only needs to store wallet addresses. Command /add-usdt <wallet_address> Requirements Validate Ethereum format: Starts with 0x 42 characters Allow users to update anytime Store wallet address linked to Discord ID Confirm: “USDT wallet saved successfully.” Admin Access Admin must be able to: View wallet of a user Export wallets in Excel Export must include: Username Discord ID Total Earnings Wallet Address Payments will be handled manually outside the bot. 9. Admin Commands Full admin control required: /campaign create /campaign edit /campaign end /campaign delete /set cpm /set budget /set minviews /export /addclipper /removeclipper /resetstats /retrack <submission_id> /mark-paid /reject 10. Excel Export Format: .xlsx One sheet per campaign Include: Submission ID Username Platform URL Views Earnings Status Wallet Address 11. Leaderboard & Ranking Auto updating Must handle up to 10,000 submissions/month Sorted by: Views OR Earnings Display top 10 users 12. Database Requirements SQLite Indexed for performance Unique Submission IDs URL uniqueness enforcement Must support 10k+ submissions monthly efficiently 13. Technical Requirements Discord Slash Commands Background scheduler (3-hour tracking job) Retry system for failed tracking Admin notification system Modular structure Logging system Clean documentation 14. Deliverables Developer must provide: Full source code Database schema Setup instructions .env configuration guide Tracking implementation explanation Deployment instructions Logging documentation Deliverables 1. Fully commented source code pushed to a private Git repo. 2. Step-by-step setup guide (dependencies, how to create API tokens for YouTube, Instagram, TikTok and X, and how to invite the bot). Acceptance criteria • Bot runs on my test server for 48 hours without crashing. • No duplicate messages for the same clip. • Embed formatting matches Discord’s standard preview style on both desktop and mobile. If any platform rate limits appear, suggest sensible back-off logic or caching so we stay compliant. Looking forward to seeing how you approach the multi-platform polling and deduplication logic.