{"id":15653725,"url":"https://github.com/ryanio/opensea-activity-bot","last_synced_at":"2025-10-07T18:35:23.284Z","repository":{"id":128100210,"uuid":"441626550","full_name":"ryanio/opensea-activity-bot","owner":"ryanio","description":"A bot that shares new OpenSea events for a collection to Discord and Twitter.","archived":false,"fork":false,"pushed_at":"2023-12-14T18:03:57.000Z","size":3227,"stargazers_count":31,"open_issues_count":0,"forks_count":18,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-19T07:47:11.982Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ryanio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-25T07:20:25.000Z","updated_at":"2025-01-05T09:44:38.000Z","dependencies_parsed_at":"2024-10-23T03:37:10.564Z","dependency_job_id":"51922b1c-504f-4004-a791-7780799f2593","html_url":"https://github.com/ryanio/opensea-activity-bot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanio%2Fopensea-activity-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanio%2Fopensea-activity-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanio%2Fopensea-activity-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanio%2Fopensea-activity-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryanio","download_url":"https://codeload.github.com/ryanio/opensea-activity-bot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251751008,"owners_count":21637837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T12:46:45.412Z","updated_at":"2025-10-07T18:35:23.278Z","avatar_url":"https://github.com/ryanio.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# opensea-activity-bot\n\n![Example Discord messages](./example-discord.png)\n\nA bot that shares new OpenSea events for a collection to Discord and Twitter.\n\nDesigned to handle multiple output configurations, like a Discord activity feed and a Twitter sales feed.\n\nOriginally developed for [@dutchtide](https://twitter.com/dutchtide)'s [𝕄𝕚𝕕𝕟𝕚𝕘𝕙𝕥 夏季 𝔹𝕣𝕖𝕖𝕫𝕖](https://opensea.io/collection/midnightbreeze) collection.\n\nAn OpenSea API key is needed - create one in your account.\n\nTo run multiple instances of this bot at once check out [bot-runner](https://github.com/ryanio/bot-runner). Also check out [discord-nft-embed-bot](https://github.com/ryanio/discord-nft-embed-bot).\n\n## Setup\n\n### Env\n\nPlease define the env variables outlined in this section for the repository to work as intended.\n\n**Valid event types**\n\nValid string values for event types to react on are:\n\n- `listing`\n- `offer`\n- `sale`\n- `transfer`\n\n#### Project-specific\n\n- `CHAIN`\n  - Value from [OpenSea Supported Chains](https://docs.opensea.io/reference/supported-chains). Defaults to `ethereum`.\n- `TOKEN_ADDRESS`\n\n#### APIs\n\n- `OPENSEA_API_TOKEN`\n\n#### To share on Discord\n\n- `DISCORD_EVENTS`\n  - The Discord channel ID with a comma separated list of event types for the bot to send through discord\n    - e.g. `662377002338091020=order,sale`\n  - For multiple channels separate with an ampersand (\u0026)\n    - e.g. `662377002338091020=order\u0026924064011820077076=sale,transfer`\n- `DISCORD_TOKEN`\n  - To get your `DISCORD_TOKEN`, [create a Discord app](https://discord.com/developers/applications). Create a bot with the permissions: `Send Messages` and `Embed Links`. Then [add your bot to your server](https://discordjs.guide/preparations/adding-your-bot-to-servers.html#bot-invite-links).\n  - The `DISCORD_TOKEN` looks like this: `OTE5MzY5ODIyNzEyNzc5NzUz.YBuz2g.x1rGh4zx_XlSNj43oreukvlwsfw`\n\nIf your discord bot is not able to post messages ensure it is added to the channels you've specified and it has the permissions to `Send Messages` and `Embed Links`.\n\n#### To tweet\n\n- `TWITTER_EVENTS`\n  - Comma separated list of event types for the bot to tweet\n  - e.g. `sale,transfer`\n\nCreate an application in the [Twitter Developer Platform](https://developer.twitter.com/) with write permissions. Provide OAuth1 tokens:\n\n- `TWITTER_CONSUMER_KEY`\n- `TWITTER_CONSUMER_SECRET`\n- `TWITTER_ACCESS_TOKEN`\n- `TWITTER_ACCESS_TOKEN_SECRET`\n\nThe bot uses `twitter-api-v2` and tweets via the v2 API with media uploaded through v1.1 using OAuth1. See library docs for details: [node-twitter-api-v2 docs](https://github.com/PLhery/node-twitter-api-v2/tree/master/doc).\n\n#### Optional\n\n- `OPENSEA_BOT_INTERVAL`\n  - Number of seconds interval for the bot to run (default: 60)\n- `QUERY_LIMIT`\n  - Limit for the OpenSea Events query (default: 50)\n- `MIN_OFFER_ETH`\n  - Offers or bids less than this amount will be ignored (default: 0)\n- `TWITTER_PREPEND_TWEET`\n  - Message to add to start of tweet, such as a hashtag\n- `TWITTER_APPEND_TWEET`\n  - Message to add to end of tweet, such as a hashtag\n\n#### Logging\n\n- `LOG_LEVEL`\n  - Controls log verbosity: `debug`, `info`, `warn`, or `error` (default: `info`)\n  - Example: `LOG_LEVEL=debug yarn start` enables debug logs across the app\n\n### Run\n\n`yarn start`\n\n#### Running on a server\n\nI recommend to use DigitalOcean over Heroku for improved stability. Heroku servers can restart (cycle) which can lead to duplicate posts since the ephemeral disk is lost.\n\nMy preferred setup is a $5/month Basic Droplet with Ubuntu. Install Node v22 and yarn, clone this repo, cd into it, run `yarn`, install [pm2](https://pm2.keymetrics.io/) with `yarn global add pm2`, set env vars, run `pm2 start yarn -- start`. Monitor with `pm2 list` and `pm2 logs`. Add log rotation module to keep default max 10mb of logs with `pm2 install pm2-logrotate`. To respawn after reboot, set your env vars in `/etc/profile`, then run `pm2 startup` and `pm2 save`.\n\nSupport this project by using the referral badge below:\n\n[![DigitalOcean Referral Badge](https://web-platforms.sfo2.digitaloceanspaces.com/WWW/Badge%203.svg)](https://www.digitalocean.com/?refcode=3f8c76216510\u0026utm_campaign=Referral_Invite\u0026utm_medium=Referral_Program\u0026utm_source=badge)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanio%2Fopensea-activity-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryanio%2Fopensea-activity-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanio%2Fopensea-activity-bot/lists"}