Skip to content

๐Ÿค– A fun multipurpose Telegram bot built with Node.js โ€” features random cards, meme tools, utilities & more. Clean code, API-powered, and easy to customize. Fork it, deploy it, go sus!

License

Notifications You must be signed in to change notification settings

1dev-hridoy/Sus-Bot-TG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

25 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Sus-Apis Telegram Bot

SUS BOT Banner

Node.js Telegram MongoDB License

A feature-rich Telegram bot built with Node.js, offering moderation tools, economy system, entertainment commands, and utility features. Powered by the Sus-Apis external API for enhanced functionality.

โœจ Features

๐Ÿ›ก๏ธ Moderation

  • User Management: Ban/unban users with reason tracking
  • Prefix Control: Customizable command prefixes per server
  • Admin Controls: Role-based permission system
  • Message Filtering: Automated content moderation

๐Ÿ’ฐ Economy System

  • Balance Management: Check, deposit, and withdraw virtual currency
  • Work Commands: Earn money through various activities
  • Shopping System: Purchase items from the bot store
  • Transaction History: Track all economic activities

๐ŸŽฎ Entertainment

  • Interactive Games: Country guessing games with scoring
  • Music Integration: YouTube audio playback capabilities
  • Dad Jokes: Endless supply of family-friendly humor
  • Memes: Random meme generation and sharing
  • Color Generator: Create beautiful color palettes

๐Ÿ”ง Utility Tools

  • QR Code Generation: Create custom QR codes instantly
  • File Operations: Upload, download, and manage files
  • API Integration: Seamless external API connectivity
  • Canvas Support: Image manipulation and creation

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 16.x or higher
  • MongoDB database
  • Telegram Bot Token from @BotFather

Installation

  1. Clone the Repository

    git clone https://github.com/1dev-hridoy/Sus-Apis.git
    cd Sus-Apis
    
  2. Install Dependencies

    npm install
    
  3. Environment Setup

    Rename example.env to .env and configure:

    TELEGRAM_BOT_TOKEN=your_bot_token_here
    MONGODB_URI=your_mongodb_connection_string
    
  4. Configure Bot Settings

    Update src/config/settings.json:

    {
      "botName": "Sus-Apis Bot",
      "ownerName": "Your Name",
      "ownerUid": "your_telegram_user_id",
      "admins": ["admin_user_id_1", "admin_user_id_2"],
      "botPrefix": "!",
      "botLanguage": "en"
    }
    
  5. Launch the Bot

    npm start
    

๐Ÿ“‹ Command Examples

Basic Commands

  • !help - Display all available commands
  • !ping - Check bot response time
  • !info - Get bot information

Economy Commands

  • !balance - Check your current balance
  • !work - Earn money through work
  • !shop - Browse the bot store
  • !transfer @user amount - Send money to another user

Entertainment Commands

  • !guess-country - Start a country guessing game
  • !joke - Get a random dad joke
  • !meme - Generate a random meme
  • !color - Generate a random color palette

Utility Commands

  • !qr text - Generate QR code
  • !play song_name - Play music from YouTube
  • !weather city - Get weather information

๐Ÿ—๏ธ Project Structure

Sus-Apis/
โ”œโ”€โ”€ ๐Ÿ“ bin/                    # Binary files
โ”œโ”€โ”€ ๐Ÿ“ src/                    # Source code
โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ bot.js             # Main bot logic
โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ index.js           # Entry point
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ assets/            # Static assets
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ caches/            # Cache files
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ config/            # Configuration files
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ settings.json  # Bot settings
โ”‚   โ”‚   โ””โ”€โ”€ ๐Ÿ“„ db.js         # Database configuration
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ models/            # Database models
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ scripts/           # Command and event handlers
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ commands/      # Bot commands
โ”‚   โ”‚   โ””โ”€โ”€ ๐Ÿ“ events/        # Event listeners
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ temp/              # Temporary files
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ tmp/               # Temporary storage
โ”‚   โ””โ”€โ”€ ๐Ÿ“ utils/             # Utility functions
โ”œโ”€โ”€ ๐Ÿ“„ package.json           # Dependencies
โ”œโ”€โ”€ ๐Ÿ“„ README.md             # Documentation
โ””โ”€โ”€ ๐Ÿ“„ .env                  # Environment variables

๐Ÿ› ๏ธ Creating Custom Commands

Step 1: Create Command File

Create a new file in src/scripts/commands/ directory:

// src/scripts/commands/example.js
const User = require('../../models/User');

module.exports = {
  name: "example",
  description: "Example command that greets the user",
  category: "Fun",
  usePrefix: true,
  cooldown: 3000, // 3 seconds cooldown
  
  async execute(bot, msg) {
    const chatId = msg.chat.id;
    const userId = msg.from.id.toString();
    const messageId = msg.message_id;
    const userName = msg.from.first_name;

    try {
      // Find or create user
      let user = await User.findOne({ telegramId: userId });
      if (!user) {
        user = new User({
          telegramId: userId,
          username: msg.from.username,
          firstName: msg.from.first_name,
          lastName: msg.from.last_name,
        });
      }

      // Update user statistics
      await user.updateOne({ 
        lastInteraction: new Date(), 
        $inc: { commandCount: 1 } 
      });
      await user.save();

      // Send response
      await bot.sendMessage(chatId, `Hello, ${userName}! ๐ŸŽ‰\nThanks for using the example command!`, {
        reply_to_message_id: messageId,
        parse_mode: 'HTML'
      });

    } catch (error) {
      console.error('Example command error:', error.message);
      await bot.sendMessage(chatId, 'โŒ Something went wrong. Please try again!', {
        reply_to_message_id: messageId
      });
    }
  }
};

Step 2: Test Your Command

  • Restart the bot: npm start
  • Use the command: !example
  • Check for any errors in the console

๐Ÿ”ง API Integration

The bot integrates with the Sus-Apis external service for enhanced functionality:

const axios = require('axios');

// Example API call
const response = await axios.get('https://sus-apis.onrender.com/api/random-color');
const colorData = response.data;

๐Ÿ“Š Database Schema

User Model

{
  telegramId: String,
  username: String,
  firstName: String,
  lastName: String,
  balance: Number,
  lastInteraction: Date,
  commandCount: Number,
  joinDate: Date
}

๐Ÿค Contributing

We welcome contributions! Here's how you can help:

  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 Branch

    git push origin feature/amazing-feature
    
  5. Open a Pull Request

Development Guidelines

  • Follow existing code style
  • Add tests for new features
  • Update documentation
  • Test thoroughly before submitting

๐Ÿ’ฌ Need Help?

If you need any help or support, feel free to join our Telegram group.
Weโ€™re active, friendly, and ready to assist you anytime ๐Ÿ˜Ž

Join Telegram

๐Ÿ“ License

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

๐Ÿ™ Acknowledgments

๐Ÿ“ž Support


Made with โค๏ธ by 1dev-hridoy

โญ Star this repository if you find it helpful!

About

๐Ÿค– A fun multipurpose Telegram bot built with Node.js โ€” features random cards, meme tools, utilities & more. Clean code, API-powered, and easy to customize. Fork it, deploy it, go sus!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published