Skip to content
bpinnycPublic

About

Create a telegram bot and interact with different AI models using Nous Research API

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Latest commit

 

History

21 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

nous-bot

First off, I copied most of this from zunxbt so you better go follow him, star his git, thank him for being such a great guy and whatever else you can do to show appreciation for what he provides to us degens: zun git.

Please star this repo, follow my git and give me a follow on X if you find this helpful: bp. I think you should also try out Nous' worldsim models. I did a short thread on how to access them.

This will setup a Telegram bot integrating Nous Research's AI models for text generation.

📋 Prerequisites

  • Node.js
  • npm/yarn
  • Telegram account & bot token
  • Nous API Key - sign up, may have to wait a bit to get approved for access.

📥 Installation

  1. Install Node.js and npm if not installed already
curl -sSL https://raw.githubusercontent.com/zunxbt/installation/main/node.sh | bash
  1. Clone Repository
rm -rf nous-bot && git clone https://github.com/bpinnyc/nous-bot.git && cd nous-bot
  1. Install dependencies
npm install axios@^1.8.3 dotenv@^16.4.7 telegraf@^4.16.3 telegraf-session-local@^2.1.1
  1. Install screen and nano package
sudo apt update && sudo apt install -y screen nano

⚙️ Configuration

  1. Get Telegram Bot Token
  • Open Telegram and search for @BotFather
  • Create new bot with /newbot
  • Copy the provided HTTP API token
  1. Get Nous API Key
  • Sign Up or Log In at Nous API Website and request access to the API key. Once you have it then you can continue.
  • Go to Settings → API Keys
  • Create/copy your API key

🛠️ Environment Set Up

  • Create .env file using the below command
nano .env
  • Now input your Telegram Bot Token
TELEGRAM_BOT_TOKEN=your_telegram_bot_token
  • Now save this file using Ctrl + X and then Y and then press Enter

⚡ Run the bot

  • Create a screen session
screen -S nous
  • Now run the below command
node bot.js
  • Now detach from this screen session using Ctrl + A, then press D

📜 Commands

Command Description
/start Start the bot
/switch Change model
/remove Remove API key
/help Show commands

🔒 Security

  • API keys stored only in session memory
  • Keys automatically cleared with /remove command
  • No persistent storage of credentials

About

Create a telegram bot and interact with different AI models using Nous Research API

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages