{"id":19450185,"url":"https://github.com/webexsamples/bitcoin-bot-sample","last_synced_at":"2026-04-19T15:31:08.879Z","repository":{"id":114828909,"uuid":"546292840","full_name":"WebexSamples/bitcoin-bot-sample","owner":"WebexSamples","description":"A funtional usage of a Webex bot that interacts with the CoinGecko API to provide real time crypto prices to Webex users.","archived":false,"fork":false,"pushed_at":"2024-04-30T18:32:24.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-25T09:22:05.492Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WebexSamples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-10-05T21:20:02.000Z","updated_at":"2024-05-08T00:41:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"fd3900b7-1939-4bba-9be4-dc994c323e09","html_url":"https://github.com/WebexSamples/bitcoin-bot-sample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/WebexSamples/bitcoin-bot-sample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebexSamples%2Fbitcoin-bot-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebexSamples%2Fbitcoin-bot-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebexSamples%2Fbitcoin-bot-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebexSamples%2Fbitcoin-bot-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WebexSamples","download_url":"https://codeload.github.com/WebexSamples/bitcoin-bot-sample/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebexSamples%2Fbitcoin-bot-sample/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32011900,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-10T16:35:37.809Z","updated_at":"2026-04-19T15:31:08.869Z","avatar_url":"https://github.com/WebexSamples.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bitcoin Bot Sample\n\nA comprehensive Webex Teams bot that provides cryptocurrency price information and interactive features using the Webex Node Bot Framework.\n\n## 🎯 Features\n\n- **Multi-Crypto Support**: Get prices for Bitcoin, Ethereum, Tether, and Matic Network\n- **Interactive Cards**: Modern Adaptive Cards UI for price requests and moonshot analysis\n- **Hash Functionality**: SHA1 encryption for text messages\n- **Real-time Data**: Live cryptocurrency prices from CoinGecko API\n- **Multiple Currency Pairs**: Support for USD, EUR, CNY, INR, GBP, AUD, CAD, CHF, HKD, JPY, NZD\n- **Threaded Replies**: Reply to messages with price information\n- **Moon Analysis**: Get \"moonlinessz\" ratings with historical price data\n\n## 📺 Webinar\n\nThis code was covered during a **Webex Developer Webinar** on **November 2nd, 2022**.\n\n- **Recording Link**: [Watch the webinar](https://developer.webex.com/webinars)  \n  **Password**: `8qCvnWBC`\n\n## 🚀 Commands\n\n| Command | Description |\n|---------|-------------|\n| `help` | Show available commands |\n| `explain` | Get bot purpose and functionality overview |\n| `bitcoin` | Get current Bitcoin price in USD |\n| `ethereum` | Get current Ethereum price in USD |\n| `prices` | Interactive card to select cryptocurrency and currency pair |\n| `ath` / `wen moon` | Get moonshot analysis with historical data |\n| `tell em btc` / `tell em eth` | Reply to message with crypto price |\n| `hash it` / `sha1` | Encrypt text using SHA1 algorithm |\n\n## 🛠️ Technology Stack\n\n- **Node.js**: Runtime environment\n- **Express.js**: Web framework for webhook handling\n- **Webex Node Bot Framework**: Bot development framework\n- **CoinGecko API**: Cryptocurrency price data\n- **Adaptive Cards**: Interactive UI components\n- **SHA1**: Cryptographic hashing\n\n## 📋 Prerequisites\n\n- Node.js (v14 or higher)\n- Webex Teams account\n- Bot token from [Webex Developer Portal](https://developer.webex.com/)\n- Public URL for webhook (use ngrok for local development)\n\n## 📦 Installation\n\n1. **Clone the repository:**\n   ```bash\n   git clone https://github.com/WebexSamples/bitcoin-bot-sample.git\n   cd bitcoin-bot-sample\n   ```\n\n2. **Install dependencies:**\n   ```bash\n   npm install\n   ```\n\n3. **Configure the bot:**\n   - Copy `config-template.json` to `config.json`\n   - Update with your bot token and webhook URL:\n   ```json\n   {\n     \"webhookUrl\": \"https://your-ngrok-url.ngrok.io\",\n     \"token\": \"YOUR_BOT_TOKEN_HERE\",\n     \"port\": 7001\n   }\n   ```\n\n4. **Start the bot:**\n   ```bash\n   npm start\n   ```\n\n## 🔧 Configuration\n\nCreate a `config.json` file with the following structure:\n\n```json\n{\n  \"webhookUrl\": \"https://your-public-url.com\",\n  \"token\": \"YOUR_WEBEX_BOT_TOKEN\",\n  \"port\": 7001\n}\n```\n\n### Getting Your Bot Token\n\n1. Go to [Webex Developer Portal](https://developer.webex.com/)\n2. Sign in with your Webex account\n3. Create a new bot application\n4. Copy the generated bot token\n\n### Setting Up Webhook URL\n\nFor local development, use ngrok:\n```bash\nngrok http 7001\n```\nCopy the HTTPS URL and use it in your config.json.\n\n## 💡 Usage Examples\n\n### Basic Price Commands\n```\n@YourBot bitcoin\n@YourBot ethereum\n```\n\n### Interactive Price Card\n```\n@YourBot prices\n```\nThis displays an interactive card where users can select:\n- Cryptocurrency (Bitcoin, Ethereum, Tether, Matic)\n- Currency pair (USD, EUR, CNY, INR)\n\n### Moon Analysis\n```\n@YourBot wen moon\n@YourBot ath\n```\nReturns detailed analysis including:\n- Current price vs all-time high\n- Price change percentages\n- Historical data\n- \"Moonlinessz\" rating\n\n### Hash Functionality\n```\n@YourBot hash this my secret message\n```\nReturns SHA1 hash with 0x prefix (EVM-style).\n\n## 🏗️ Architecture\n\nThe bot follows an event-driven architecture:\n\n1. **Webhook Endpoint**: Receives messages from Webex\n2. **Command Processing**: Pattern matching for user commands\n3. **API Integration**: Fetches data from CoinGecko API\n4. **Response Generation**: Sends formatted responses or interactive cards\n5. **Card Actions**: Handles user interactions with Adaptive Cards\n\n## 📊 API Integration\n\n### CoinGecko API\n- **Base URL**: `https://api.coingecko.com/api/v3/`\n- **Endpoint**: `/coins/{id}`\n- **Rate Limits**: Respects API rate limits\n- **Data Points**: Current price, market cap, volume, historical data\n\n### Supported Cryptocurrencies\n- Bitcoin (bitcoin)\n- Ethereum (ethereum)\n- Tether (tether)\n- Matic Network (matic-network)\n- And 20+ more in moon analysis\n\n## 🔒 Security\n\n- Bot token stored in configuration file (not in source code)\n- SHA1 hashing for text encryption\n- Input validation for user commands\n- Error handling for API failures\n\n## 🐛 Error Handling\n\nThe bot includes comprehensive error handling:\n- API request failures\n- Invalid user inputs\n- Network connectivity issues\n- Card action processing errors\n\n## 📈 Monitoring\n\nHealth check endpoint available at:\n```\nGET /\nResponse: \"I'm alive.\"\n```\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create a feature branch: `git checkout -b feature/new-feature`\n3. Commit changes: `git commit -am 'Add new feature'`\n4. Push to branch: `git push origin feature/new-feature`\n5. Submit a pull request\n\n## 📝 License\n\nThis project is licensed under the ISC License. See the [LICENSE](LICENSE) file for details.\n\n## 🆘 Support\n\n- Create an issue in this repository\n- Contact [Webex Developer Support](https://developer.webex.com/support)\n- Check the [Webex Bot Framework documentation](https://github.com/WebexCommunity/webex-node-bot-framework)\n\n## 🔗 Related Resources\n\n- [Webex Developer Portal](https://developer.webex.com/)\n- [CoinGecko API Documentation](https://www.coingecko.com/en/api)\n- [Adaptive Cards Documentation](https://adaptivecards.io/)\n- [Webex Bot Framework](https://github.com/WebexCommunity/webex-node-bot-framework)\n\n---\n\n**Author**: Aaron Burns  \n**Repository**: https://github.com/WebexSamples/bitcoin-bot-sample\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebexsamples%2Fbitcoin-bot-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebexsamples%2Fbitcoin-bot-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebexsamples%2Fbitcoin-bot-sample/lists"}