Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sabber-slt/claude-telegram-bot
This is a simple Telegram bot that uses the Claude AI API for natural language conversations.
https://github.com/sabber-slt/claude-telegram-bot
api docker docker-compose nodejs telegraf telegram telegram-bot
Last synced: 2 days ago
JSON representation
This is a simple Telegram bot that uses the Claude AI API for natural language conversations.
- Host: GitHub
- URL: https://github.com/sabber-slt/claude-telegram-bot
- Owner: sabber-slt
- Created: 2023-07-24T13:19:59.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-24T15:20:06.000Z (over 1 year ago)
- Last Synced: 2023-07-24T16:34:24.152Z (over 1 year ago)
- Topics: api, docker, docker-compose, nodejs, telegraf, telegram, telegram-bot
- Language: JavaScript
- Homepage: https://sabber.dev
- Size: 18.6 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Claude 2 AI Telegram Bot
This is a simple Telegram bot that uses the Claude AI API for natural language conversations.
Since Anthropic has been reluctant to provide API access unless you're a major org, the only way to access Claude is through the unofficial API. Note that this is unstable as they may push breaking changes and there is risk of your account being banned, for which I will not be liable.
# Features
- **Starts a new Claude AI conversation when a user first messages the bot**
- **Saves the conversation ID to link future messages from the same user**
- **Allows deleting the conversation history with the /delete command**
- **The app is configured to run in a Docker container for easy deployment and portability**### How to install ?
Get sessionKey from the sessionKey cookie via the Claude website.
```sh
const claude = new Claude({
sessionKey: 'YOUR_SESSION_KEY'
});
```with docker you should first install docker and docker-compose and then run the following command:
```sh
docker-compose up -d
```- Sign up for a Claude AI account and get an API key
- Second acquire telegram token from the BOTFATHER. [Telegram token](https://telegram.me/BotFather)
- Clone This repo
- Cd claude-telegram
- Put your api keys in .env
- If you have installed docker in your system just run docker-compose up -d and ignore rest
- To install all modules `yarn`
- To run developer server `yarn dev`
- You can install pm2 globally before deploying. `yarn add pm2 -g`
- Then run `pm2 start index.js`## API KEYS
```sh
BOT_TOKEN= "your telegram api key"
SESSION= "your claude seesion"
```