{"id":15685487,"url":"https://github.com/ryanio/discord-nft-embed-bot","last_synced_at":"2025-05-07T18:09:16.867Z","repository":{"id":41138289,"uuid":"439182230","full_name":"ryanio/discord-nft-embed-bot","owner":"ryanio","description":"A discord.js bot that listens to messages in channels and replies with items from an nft collection.","archived":false,"fork":false,"pushed_at":"2023-12-21T02:01:02.000Z","size":1931,"stargazers_count":12,"open_issues_count":0,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-07T18:05:22.341Z","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-17T02:04:35.000Z","updated_at":"2025-01-05T09:44:30.000Z","dependencies_parsed_at":"2023-12-11T01:24:26.293Z","dependency_job_id":"ef733bc0-c6dd-45f6-9dfd-be5262c11967","html_url":"https://github.com/ryanio/discord-nft-embed-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%2Fdiscord-nft-embed-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanio%2Fdiscord-nft-embed-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanio%2Fdiscord-nft-embed-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanio%2Fdiscord-nft-embed-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryanio","download_url":"https://codeload.github.com/ryanio/discord-nft-embed-bot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252931533,"owners_count":21827111,"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-03T17:25:30.998Z","updated_at":"2025-05-07T18:09:16.845Z","avatar_url":"https://github.com/ryanio.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# discord-nft-embed-bot\n\nA [discord.js](https://discord.js.org/) bot that listens to messages in channels and replies with items from an nft collection.\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 [opensea-activity-bot](https://github.com/ryanio/opensea-activity-bot).\n\n**Supported syntax**:\n\n- `#1234`\n- `#random` or `#rand` or `#?`\n\nExample reply:\n\n![Example bot reply](./example.png)\n\nExample console output:\n\n```\n------------------------------------------------------------\nLogged in as Dutchtide Listen Bot#8486!\nListening for messages…\n------------------------------------------------------------\nMessage from ryanio in #🌴🎐view-the-breeze🎐🌴:\n\u003e #random\nFetching #2248…\nReplied with #2248\n------------------------------------------------------------\n```\n\nProvided metadata fields:\n\n- Owner\n- Last sale\n- Listed for\n- Best offer\n\nYou can add specific properties of the nft by formatting `nft.traits` and adding to the `fields` array.\n\n## Setup\n\n### Env\n\nPlease define the following env variables for the repository to work as intended.\n\n#### APIs\n\n- `DISCORD_TOKEN`\n- `OPENSEA_API_TOKEN`\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_NAME`\n- `TOKEN_ADDRESS`\n- `MIN_TOKEN_ID`\n- `MAX_TOKEN_ID`\n\n#### Optional\n\n- `RANDOM_INTERVALS`\n  - A comma-separated list of `channelId=intervalInMinutes` e.g. `662377002338091020=5,924064011820077076=10` to send random items to channels in intervals.\n- `CUSTOM_DESCRIPTION`\n  - A custom description for the embed. The string `{id}` is replaced with the token ID.\n\n### Bot\n\nTo get your `DISCORD_TOKEN`, [create a Discord app](https://discord.com/developers/applications). Create a bot with the permissions: `Read Messages/View Channels`, `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). The bot will listen and reply to messages in all of the channels it has access to.\n\nThe `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 `Read Messages/View Channels`, `Send Messages` and `Embed Links`, and that you have also enabled `Message Content Intent` on your bot page.\n\n### Run\n\n`yarn start`\n\n#### Running on a server\n\nMy preferred setup is a $5/month Basic Droplet with Ubuntu. Install Node v16 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\nYou can support this repository (and get your first two months free) with 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\n##### Heroku\n\nA `Procfile` is included for easy use.\n\nClone this repo, push it to heroku, set up the environment variables above, and spin up a worker with `heroku ps:scale web=0 worker=1`\n\nThen watch the logs with `heroku logs --tail`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanio%2Fdiscord-nft-embed-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryanio%2Fdiscord-nft-embed-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanio%2Fdiscord-nft-embed-bot/lists"}