Skip to content

Shashank519915/StellaBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#ProjectStellaBot v2.0

🤖 Project Stella Bot

Project Stella Bot Logo

A Feature-Rich Discord Bot with Journal System & Smart Utilities

Discord.js Node.js MongoDB Express.js Render

License

Bot Status Version Uptime

📋 Features🚀 Quick Start📖 Commands🛠️ Installation📚 API Reference


✨ Features

📔 Advanced Journal System

  • Personal Journaling: Save daily thoughts with automatic timestamping
  • Grammar Correction: Powered by TextGears API for intelligent text improvement
  • Smart Navigation: Browse entries with paginated display (5 per page)
  • Entry Management: Edit, delete, and organize your journal seamlessly
  • Secure Storage: MongoDB Atlas integration for reliable data persistence

🌤️ Weather Intelligence

  • Real-time Forecasts: Current weather conditions for any global location
  • Smart Emojis: Dynamic weather icons based on conditions
  • Temperature Display: Celsius format with detailed descriptions
  • Location Validation: Secure input handling with format checking

🎮 Interactive Entertainment

  • Trivia Challenges: 15-second timed questions from Open Trivia Database
  • Random Jokes: Family-friendly humor from JokeAPI
  • Social Greetings: Customizable welcome messages with user mentions

🔧 Utility Commands

  • Comprehensive Help: Detailed command documentation with examples
  • Mention Responses: Smart bot interaction when tagged
  • Error Handling: Robust error management with user-friendly messages

🏗️ Tech Stack

Backend & Core

Node.js Discord.js JavaScript Express.js

Database & Storage

MongoDB Mongoose

External APIs

OpenWeatherMap TextGears JokeAPI Open Trivia DB

HTTP & Networking

Node-Fetch

Hosting & Deployment

Hosted on Render


🚀 Quick Start

Join Our Production Discord Server

🎯 Join and use Project Stella Bot in this Server

Try These Commands:

  1. !help - Get familiar with all features
  2. !journal Hello Stella! - Create your first journal entry
  3. !weather your-city - Check your local weather
  4. !trivia - Test your knowledge

Bot status on Uptime Robot

Uptime Keep-Alive: An Express-based keep-alive route ensures the bot stays live on Render.


📖 Commands

Command Description Usage Example
!journal [entry] 📝 Save daily thoughts with grammar check !journal Today was amazing!
!showall 📚 View paginated journal history !showall
!delete 🗑️ Navigate and remove journal entries !delete
!weather [location] 🌤️ Get real-time weather forecasts !weather London
!trivia 🧠 Answer timed trivia questions !trivia
!joke 😂 Get random family-friendly jokes !joke
!greet @user 👋 Send personalized greetings !greet @username
!help ❓ Display detailed command guide !help

🔍 Command Details

Journal System Commands

# Save a new journal entry
!journal Today I learned something new about JavaScript closures.

# View all your entries (paginated)
!showall

# Delete entries with navigation
!delete

Utility Commands

# Get weather for any city
!weather New York
!weather Tokyo, Japan

# Start a trivia challenge
!trivia

# Get a random joke
!joke

# Greet another user
!greet @username


🛠️ Installation

Prerequisites

  • Node.js 18.x or higher
  • MongoDB Atlas account
  • Discord Bot Token
  • API Keys (OpenWeatherMap, TextGears)

1. Clone Repository

git clone https://github.com/Shashank519915/StellaBot.git
cd StellaBot

2. Install Dependencies

npm install discord.js mongoose node-fetch express

3. Environment Setup

Create config.json in the root directory:

{
  "prefix": "!",
  "token": "YOUR_DISCORD_BOT_TOKEN",
  "weatherapikey": "YOUR_OPENWEATHERMAP_API_KEY", 
  "textgearapikey": "YOUR_TEXTGEARS_API_KEY",
  "mongoUri": "YOUR_MONGODB_CONNECTION_STRING"
}

4. Get API Keys

Discord Bot Token

  1. Visit Discord Developer Portal
  2. Create new application → Bot section
  3. Copy token to config.json

OpenWeatherMap API

  1. Register at OpenWeatherMap
  2. Get free API key
  3. Add to config.json

TextGears API

  1. Sign up at RapidAPI TextGears
  2. Subscribe to free plan
  3. Copy API key to config.json

MongoDB Atlas

  1. Create cluster at MongoDB Atlas
  2. Get connection string
  3. Add to config.json

5. Launch Bot

node bot.js

You should see:

🔗 Connecting to MongoDB...
✅ MongoDB Connected
🤖 Logging in to Discord...
🤖 Bot is ready!

📁 Project Structure

stella-bot/
├── 📄 bot.js                 # Main bot entry point
├── 📄 db.js                  # MongoDB connection & models
├── 📄 config.json            # Configuration file
├── 📁 Commands/
│   ├── 📄 journalCommand.js      # Journal system logic
│   ├── 📄 showallJournalCommand.js # Journal pagination  
│   ├── 📄 deleteCommand.js       # Entry deletion with navigation
│   ├── 📄 weatherCommand.js      # Weather API integration
│   ├── 📄 triviaCommand.js       # Trivia game mechanics
│   ├── 📄 jokeCommand.js         # Joke API integration
│   ├── 📄 greetCommand.js        # User greeting system
│   ├── 📄 helpCommand.js         # Help documentation
│   └── 📄 mentionCommand.js      # Bot mention responses
└── 📁 models/
    └── 📄 JournalEntry.js        # Journal entry schema

🔧 Configuration

Bot Permissions Required

  • Send Messages
  • Read Message History
  • Add Reactions
  • Use External Emojis
  • Embed Links

MongoDB Schema

{
  userId: String,     // Discord user ID
  date: String,       // Entry date (formatted)
  time: String,       // Entry time (formatted)  
  content: String,    // Journal content (min 3 chars)
  timestamps: true    // Auto createdAt/updatedAt
}

📚 API Reference

Core Dependencies

{
  "discord.js": "^14.x",
  "mongoose": "^7.x",
  "express": "^5.x"
  "node-fetch": "^2.x"
}

External APIs Used

  • OpenWeatherMap: Weather data retrieval
  • TextGears: Grammar correction service
  • JokeAPI: Random joke generation
  • Open Trivia Database: Trivia questions

🤝 Contributing

We welcome contributions! Here's how to get started:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow existing code style
  • Add comments for complex logic
  • Test all commands thoroughly
  • Update documentation as needed

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


🙏 Acknowledgments

  • Discord.js team for the excellent library
  • OpenWeatherMap for reliable weather data
  • TextGears for grammar correction services
  • JokeAPI & Open Trivia DB for entertainment content

📞 Support

Need Help?

Discord Server GitHub Issues

Found a Bug? Report it here
Feature Request? Suggest it here


Made with ❤️ by Shashank Anand


Instagram Badge LinkedIn Badge Gmail Badge

Star this repo if you found it helpful!

About

This project is a Discord bot built with Node.js that features various commands including journal entry and management, grammar check, joke retrieval, greeting users, weather information, trivia questions. It utilizes Discord.js and external APIs like TextGears, OpenWeatherMaps API, JokesAPI v2.0 and Open Trivia Database API for data retrieval.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors