Skip to content

Sage is a Telegram chatbot built with Node.js, Telegraf, Wikipedia API and Cohere AI.

Notifications You must be signed in to change notification settings

renanbotasse/sageBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

SageBot

Sage - Telegram Bot 🤖🟢

Introduce

Hello there! I'm Sage, your trusty ChatBot companion! 💚

I'm here to assist you with a wide range of tasks and activities:

  • Conversations: Let's chat about anything you'd like! 👾
  • Knowledge: I'm here to share fascinating facts and help you learn. 🧐
  • Stories: Dive into adventures with me. 🌌

We can have a friendly conversation, learn something new, or immerse ourselves in captivating tales. Ready to embark on our journey? ✌️

Sage Telegram Profile

Commands

  • "start" - Begin chatting with the bot.

  • "random" - Get a random Wikipedia page.

  • "search" - Search for Wikipedia pages.

  • "sage" - Chat with the Sage AI.

  • "tale" - Ask for the AI a story.

  • "help" - See available commands.

  • "language" - Choose a language.

  • "save_link" - Save a random Wikipedia page.

  • "save_list" - Save a search list.

  • "save_tale" - Save a story.

  • "saved_link" - Display saved Wikipedia pages.

  • "saved_list" - Display saved search lists.

  • "saved_tale" - Display saved stories.

  • "delete_id" - Delete a saved link, list, or story.

  • "android" - Get information about The SageBot Project.

Getting Started

The SageBot is a Telegram chatbot built using Node.js.

Sage is powered by Cohere AI to engage users in conversation, offering stories with up to 1000 words upon request. Additionally, it utilizes the Wikipedia API to provide random pages and make small searches, presenting users with lists of potential topics.

Users can save tales, random pages, and search lists, stored in a MongoDB database. The bot also can delete the stored content.

For deployment, Sage runs on Google Cloud Run using Docker containers, ensuring easy deployment and updates. However, it can also be run locally if preferred.

The Sage Project combines Node, Telegraf, Cohere, Wikipedia, and MongoDB to provide knowledge and entertainment to users.

Configuration

Create a .env file and add the parameters like:

Parameter Description
COHERE_TOKEN Your Cohere API key, you can get it from here
TELEGRAM_BOT_TOKEN Your Telegram bot's token, obtained using BotFather
MONGODB_URI Your mongoDB connection take a look here

Deploy

Local

After creating the .env file and configuring it correctly, follow these steps:

  • Install the necessary files using npm: npm install

  • Start your local server: npm run start

That's it! You'll now be running the project locally.

Google Cloud Run

To deploy using Google Cloud Run, might seem more complex, but with Docker and a Dockerfile in place, the process becomes straightforward:

1 - If not already installed on your computer, install Docker and Docker Compose.

2 - Create the Dockerfile running docker build -t PROJECTNAME .

3 - Configure your project with Google Cloud.

4 - If not installed on your computer, install the gcloud CLI.

5 - Initialize gcloud in your project folder.

6 - Begin the deployment process with the command: gcloud run deploy.

If you encounter any issues, these links can help deploy:

A - Host Telegram bot in Node.js in Google Cloud Run - Nick Filat.

B - How to deploy an existing Docker container project to Google Cloud Run - Taylor Hughes.

C - Deploy a containerised Node.js application to Cloud Run.

Contributing

Issues and pull requests (PRs) are warmly welcomed! Whether you've spotted a bug, have an enhancement idea, or want to contribute code, your input is valued and appreciated.

Sage Resting

License

GPL-3.0

About

Sage is a Telegram chatbot built with Node.js, Telegraf, Wikipedia API and Cohere AI.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published