Discord bot to automate SourceCred instance interactions
/info
: information about available SourceCred commands/fetch-cred [user]
: fetches cred and grain information for specified Discourse username/opt-in [discourse] [address]
: allows users to opt in for SC distributions. Checks Discourse account ownership and pushes username and wallet address to Notion to be eventually synced to the SC instance- discourse: discourse username
- address: wallet address
/opt-out [discourse]
: allows users to opt out of SC distributions. Checks Discourse account ownership and pushes [discourse] username to Notion to be eventually deactivated on the SC instance- discourse: discourse username
/admin-info
: information about available SourceCred admin commands/payments-csv [threshold]
: generates SC payments CSV file filtering by users who have accumulated an amount greater than or equal to the threshold passed (generated CSV file is compatible with Gnosis Safe CSV Airdrop app)/onboard-users
: fetches user list from Notion, creates a new branch on GitHub repo, adds wallet addresses into users SC identities and activates user accounts in the SC instance. Returns the name of the new GitHub branch created/burn-grain [branch-name]
: transfers grain from SC instance users accounts to the burn grain account- branch-name: name of the GitHub branch created on the
/onboard-users
command
- branch-name: name of the GitHub branch created on the
- Copy the contents of the
.env.sample
file into a new.env
file, changing the values to your own.BOT_TOKEN
: Discord bot token, check this guide to know how to create a Discord Bot and obtain a tokenCLIENT_ID
: Discord Bot IDSOURCECRED_INSTANCE
: Path to your SourceCred instance (e.g. sourcecred/makerdao-cred/gh-pages)PINATA_AUTHORIZATION_TOKEN
: Pinata API key in the form of a Bearer token. This application uses Pinata as the IPFS pinning service. Check Pinata docs for information on how to get the API keySOURCECRED_ADMINS
: Discord ID list of users with admin permissions to the SC instance in the formats'123456789'
or'123456789, 987654321, 456789123, ...'
GITHUB_API_TOKEN
: GitHub personal access token needed to create branches and copy the ledger from one branch to another in the SC instance's GitHub repo. Check GitHub docs for information on how to create oneGH_NAME
: Name for GitHub commitsGH_EMAIL
: Email for GitHub commits
- Change the variables in src/constants/index.ts to those that apply for you.
TOKEN_CONTRACT
: Address of the token used for SourceCred grain paymentsDAI_REDEMPTIONS_ACCOUNT_ID
: ID of the SourceCred instance account set up to receive grain transfers
- Deploy the bot and invite it to your Discord server.