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.
- 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
- 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
- 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
- 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
- Node.js 16.x or higher
- MongoDB database
- Telegram Bot Token from @BotFather
-
Clone the Repository
git clone https://github.com/1dev-hridoy/Sus-Apis.git cd Sus-Apis
-
Install Dependencies
npm install
-
Environment Setup
Rename
example.env
to.env
and configure:TELEGRAM_BOT_TOKEN=your_bot_token_here MONGODB_URI=your_mongodb_connection_string
-
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" }
-
Launch the Bot
npm start
!help
- Display all available commands!ping
- Check bot response time!info
- Get bot information
!balance
- Check your current balance!work
- Earn money through work!shop
- Browse the bot store!transfer @user amount
- Send money to another user
!guess-country
- Start a country guessing game!joke
- Get a random dad joke!meme
- Generate a random meme!color
- Generate a random color palette
!qr text
- Generate QR code!play song_name
- Play music from YouTube!weather city
- Get weather information
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
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
});
}
}
};
- Restart the bot:
npm start
- Use the command:
!example
- Check for any errors in the console
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;
{
telegramId: String,
username: String,
firstName: String,
lastName: String,
balance: Number,
lastInteraction: Date,
commandCount: Number,
joinDate: Date
}
We welcome contributions! Here's how you can help:
-
Fork the Repository
-
Create a Feature Branch
git checkout -b feature/amazing-feature
-
Commit Your Changes
git commit -m 'Add amazing feature'
-
Push to Branch
git push origin feature/amazing-feature
-
Open a Pull Request
- Follow existing code style
- Add tests for new features
- Update documentation
- Test thoroughly before submitting
If you need any help or support, feel free to join our Telegram group.
Weโre active, friendly, and ready to assist you anytime ๐
This project is licensed under the ISC License - see the LICENSE file for details.
- Sus-Apis for providing the external API
- node-telegram-bot-api for Telegram integration
- All contributors who help improve this project
- Telegram Chat: Telegram
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Developer: @1dev-hridoy
Made with โค๏ธ by 1dev-hridoy
โญ Star this repository if you find it helpful!