sphinx-tribes
sphinx-tribes copied to clipboard
referrals: payout on first bounty completed
Context
referrals for hunters
Design
After you complete your FIRST bounty, check if you have a referred_by
value on your Person record.
Trigger a payout to the referred by guy via the org. (Bounty Platform org)
- org can be set via REFERRAL_ORG_ID in env
Trigger a message to the bot
- bot URL can be set with REFERRAL_BOT_URL in env
- bot secret can be set via REFERRAL_BOT_SECRET in env
- bot secret can be set via REFERRAL_BOT_ID in env
- bot tribe UUID set via REFERRAL_BOT_TRIBE in env
{
"action": "broadcast",
"bot_id": {BOT_ID},
"bot_secret": "{BOT_SECRET}",
"chat_uuid": {REFERRAL_BOT_TRIBE},
"content": "X has earned X sats by referring a new hunter!",
}
Post to the REFERRAL_BOT_URL with the above JSON data