Skip to content

VlodkoMr/chatme-chat-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChatMe Bot example

ChatMe bot that listen private messages and reply using OpenAI.

Requirements

  • nodeJS 16+

Install

  1. Install requirements:
npm install
  1. Copy ".env.sample" into ".env.testnet" and/or ".env.production" files and set environment variables:
  • NODE_ENV: testnet or mainnet environment (NEAR network).
  • BOT_PRIVATE_KEY: Private key for your bot account.
  • BOT_ACCOUNT_NAME: NEAR wallet for your bot account.

NOTE: Our bot example using OpenAI API to process responses to user and require OPENAI_API_KEY in environment file.

Local development

We recommend to use watch script for local development - it build typescript and relaunch nodeJS process:

npm run watch

Deployment & Production

Next steps required to deploy your bot:

  • Create NEAR account or use existing one as bot wallet address.
  • Check account balance, your account need some NEAR tokens to send messages.
  • Update BOT_ACCOUNT_NAME - set bot wallet address in your environment file.
  • Get private key for this NEAR account and update BOT_PRIVATE_KEY in your environment file.
  • Update bot request/response functionality in src/utils/messages.ts.
  • Build: npm run build
  • Deploy to server and run by using PM2:
    • For testnet:npm run dev:start
    • For mainnet:npm run prod:start

About

Example chatBot AI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published