Skip to content

Commit

Permalink
better readme
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotBraem committed Dec 17, 2024
1 parent a40260f commit c48a199
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 16 deletions.
10 changes: 3 additions & 7 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@
TWITTER_USERNAME=your_twitter_username
TWITTER_PASSWORD=your_twitter_password
TWITTER_EMAIL=your_twitter_email
TWITTER_API_KEY=your_twitter_api_key
TWITTER_API_SECRET=your_twitter_api_secret
TWITTER_ACCESS_TOKEN=your_twitter_access_token
TWITTER_ACCESS_TOKEN_SECRET=your_twitter_access_token_secret

# NEAR Configuration
NEAR_NETWORK_ID=testnet
NEAR_NODE_URL=https://rpc.testnet.near.org
NEAR_WALLET_URL=https://wallet.testnet.near.org
NEAR_CONTRACT_NAME=your_contract_name
NEAR_LIST_CONTRACT=your_list_contract_name
NEAR_SIGNER_ACCOUNT=your_signer_account
NEAR_SIGNER_PRIVATE_KEY=your_signer_private_key

# Environment
NODE_ENV=development
91 changes: 82 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,14 @@
- [Running the app](#running-the-app)
- [Building for production](#building-for-production)
- [Running tests](#running-tests)
- [Usage](#usage)
- [Configuration](#configuration)
- [Twitter Setup](#twitter-setup)
- [Admin Configuration](#admin-configuration)
- [NEAR Network Setup](#near-network-setup)
- [Bot Functionality](#bot-functionality)
- [Submission Process](#submission-process)
- [Moderation System](#moderation-system)
- [Rate Limiting](#rate-limiting)
- [Contributing](#contributing)

</details>
Expand All @@ -45,9 +52,16 @@ cp .env.example .env

Required environment variables:

- Twitter API credentials for bot functionality
- NEAR network configuration
- Environment settings
```
# Twitter API Credentials
TWITTER_USERNAME=your_twitter_username
TWITTER_PASSWORD=your_twitter_password
TWITTER_EMAIL=your_twitter_email
# NEAR Configuration
NEAR_NETWORK_ID=testnet
NEAR_CONTRACT_NAME=your_contract_name
```

### Running the app

Expand All @@ -71,14 +85,73 @@ bun run test

See the full [testing guide](./playwright-tests/README.md).

## Usage
## Configuration

### Twitter Setup

The bot requires a Twitter account to function. Configure the following in your `.env` file:

```env
TWITTER_USERNAME=your_twitter_username
TWITTER_PASSWORD=your_twitter_password
TWITTER_EMAIL=your_twitter_email
```

It will use these credentials to login and cache cookies via [agent-twitter-client](https://github.com/ai16z/agent-twitter-client).

### Admin Configuration

Admins are Twitter accounts that have moderation privileges. Configure admin accounts in `src/config/admins.ts`:

```typescript
export const ADMIN_ACCOUNTS: string[] = [
"admin_handle_1",
"admin_handle_2"
// Add admin Twitter handles here (without @)
]
```

Admin accounts are automatically tagged in submission acknolwedgements and can:

- Approve submissions using the `#approve` hashtag
- Reject submissions using the `#reject` hashtag

Only the first moderation will be recorded.

### NEAR Network Setup

Configure NEAR network settings in your `.env` file:

```env
NEAR_NETWORK_ID=testnet
NEAR_CONTRACT_NAME=your_contract_name
```

## Bot Functionality

### Submission Process

1. **Submit News**: Users can submit news by mentioning the bot with `!submit` in their tweet
2. **Acknowledgment**: The bot responds with a confirmation tweet, tagging the admins for review
3. **Moderation**: Admins will reply to the bot's acknowledgement with either #approve or #reject
4. **Notification**: Users receive a tweet notification about their submission's status

### Moderation System

1. **Queue**: All submissions enter a moderation queue
2. **Admin Review**: Admins can review submissions by replying to the bot's acknowledgment tweet
3. **Actions**:
- Approve: Reply with `#approve` hashtag
- Reject: Reply with `#reject` hashtag
4. **Outcome**: Users receive a notification tweet about the moderation decision

The bot provides two main interactions:
### Rate Limiting

1. **Submit News**: Tweet with `!submit` to submit news content
2. **Approve Content**: Moderators can approve content using the `#approve` hashtag
To maintain quality:

Each user is limited to 10 submissions per day to maintain quality.
- Users are limited to 10 submissions per day
- Rate limits reset daily
- Exceeding the limit results in a notification tweet

## Contributing

Expand Down

0 comments on commit c48a199

Please sign in to comment.