{"id":28477033,"url":"https://github.com/cptcr/pegasus","last_synced_at":"2025-12-30T22:44:50.153Z","repository":{"id":294934714,"uuid":"988391151","full_name":"cptcr/pegasus","owner":"cptcr","description":"Official Discord bot of Hinkos Discord. Written in TypeScript with Web-UI and German support.","archived":false,"fork":false,"pushed_at":"2025-06-23T18:24:51.000Z","size":24608,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-26T18:18:24.099Z","etag":null,"topics":["docker","next","nextauth","nextjs14","postgresql","prisma","typescript","vercel"],"latest_commit_sha":null,"homepage":"Dashboard: http://localhost:3001","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cptcr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-22T13:31:02.000Z","updated_at":"2025-06-23T18:24:45.000Z","dependencies_parsed_at":"2025-05-26T04:33:13.088Z","dependency_job_id":null,"html_url":"https://github.com/cptcr/pegasus","commit_stats":null,"previous_names":["cptcr/hinko","cptcr/pegasus"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cptcr/pegasus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cptcr%2Fpegasus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cptcr%2Fpegasus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cptcr%2Fpegasus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cptcr%2Fpegasus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cptcr","download_url":"https://codeload.github.com/cptcr/pegasus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cptcr%2Fpegasus/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263184524,"owners_count":23427036,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","next","nextauth","nextjs14","postgresql","prisma","typescript","vercel"],"created_at":"2025-06-07T15:40:19.038Z","updated_at":"2025-12-30T22:44:50.147Z","avatar_url":"https://github.com/cptcr.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 Pegasus Discord Bot\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Discord.js-v14-blue?style=for-the-badge\u0026logo=discord\" alt=\"Discord.js\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/TypeScript-5.0-007ACC?style=for-the-badge\u0026logo=typescript\u0026logoColor=white\" alt=\"TypeScript\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/PostgreSQL-16-316192?style=for-the-badge\u0026logo=postgresql\u0026logoColor=white\" alt=\"PostgreSQL\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Node.js-18+-339933?style=for-the-badge\u0026logo=node.js\u0026logoColor=white\" alt=\"Node.js\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/License-MIT-green?style=for-the-badge\" alt=\"License\"\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ch3\u003e🏆 A Production-Ready, Feature-Rich Discord Bot Built with TypeScript\u003c/h3\u003e\n  \u003cp\u003e\n    \u003ca href=\"https://discord.gg/vaultscope\"\u003eSupport Server\u003c/a\u003e •\n    \u003ca href=\"https://cptcr.dev\"\u003eDeveloper\u003c/a\u003e •\n    \u003ca href=\"#-features\"\u003eFeatures\u003c/a\u003e •\n    \u003ca href=\"#-installation\"\u003eInstallation\u003c/a\u003e •\n    \u003ca href=\"#-commands\"\u003eCommands\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\u003ch1\u003eSPONSORS\u003c/h1\u003e\n\u003cp\u003eVaultScope\u003c/p\u003e\n\u003ca\u003ehttps://vaultscope.dev\u003c/a\u003e\n\u003c/div\u003e\n\n---\n\n## 📋 Table of Contents\n\n- [✨ Features](#-features)\n- [🔧 Tech Stack](#-tech-stack)\n- [📦 Prerequisites](#-prerequisites)\n- [🚀 Installation](#-installation)\n- [⚙️ Configuration](#-configuration)\n- [📝 Commands](#-commands)\n- [🔒 Security Features](#-security-features)\n- [🌍 Internationalization](#-internationalization)\n- [🚢 Deployment](#-deployment)\n- [🤝 Contributing](#-contributing)\n- [📄 License](#-license)\n- [💬 Support](#-support)\n\n## ✨ Features\n\n### 🛡️ Advanced Moderation System\n- **Comprehensive Warning System** with automation rules and thresholds\n- **Multi-action Moderation** - Ban, kick, timeout with reason tracking\n- **Audit Logging** - Complete action history with user tracking\n- **Permission Hierarchy** - Role-based command access control\n- **Blacklist System** - Developer-only user management\n\n### 💰 Full Economy System\n- **Virtual Currency** with balance tracking and transactions\n- **5 Gambling Games**:\n  - 🎲 Dice - Roll against the house\n  - 🪙 Coinflip - 50/50 chance game\n  - 🎰 Slots - Classic slot machine\n  - ♠️ Blackjack - Full blackjack implementation\n  - 🎯 Roulette - Multiple betting options\n- **Shop System** - Buy/sell items with inventory management\n- **Work \u0026 Rob** - Earn money with cooldowns and protection items\n- **Daily Rewards** - Streak bonuses for consecutive claims\n\n### 🎉 Advanced Giveaway System\n- **Multiple Entry Methods** - Bonus entries for roles/boosters\n- **Requirements System** - Role, level, or time-based requirements\n- **Live Timer Updates** - Real-time countdown display\n- **Automatic Winner Selection** - Fair, weighted random selection\n- **Reroll Capability** - Change winners after giveaway ends\n\n### 🎟️ Professional Ticket System\n- **Custom Panels** - Design support panels with embeds\n- **Category Management** - Organize tickets by type\n- **Ticket Actions**:\n  - Claim - Assign ticket to staff\n  - Close - Close with optional reason\n  - Lock - Prevent user messages\n  - Freeze - Prevent all messages\n- **Transcript Generation** - Save ticket history\n- **Statistics Tracking** - Monitor support metrics\n\n### 📈 XP \u0026 Leveling System\n- **Voice \u0026 Text XP** - Earn XP through activity\n- **Role Rewards** - Automatic role assignment at levels\n- **Custom Rank Cards** - Personalized rank displays\n- **Leaderboards** - Server-wide rankings\n- **Booster Bonuses** - Extra XP for server boosters\n- **Channel Multipliers** - Configure XP rates per channel\n\n### 🌍 Multi-Language Support\n- **4 Languages**: English, German, Spanish, French\n- **Per-User Language** - Individual language preferences\n- **Localized Commands** - Command descriptions in all languages\n- **Dynamic Translations** - All bot responses translated\n\n### 🔧 Server Configuration\n- **Welcome/Goodbye System** - Custom messages with embeds\n- **Auto-Role Assignment** - Automatic roles for new members\n- **Language Settings** - Server-wide language preference\n- **XP Configuration** - Customize leveling system\n- **Economy Settings** - Adjust currency and rewards\n\n## 🔧 Tech Stack\n\n| Technology | Purpose |\n|------------|---------|\n| **TypeScript 5.0** | Type-safe development with strict mode |\n| **Discord.js v14** | Latest Discord API features |\n| **PostgreSQL 16** | Robust relational database |\n| **Drizzle ORM** | Type-safe database queries |\n| **Zod** | Runtime validation and type safety |\n| **i18next** | Internationalization framework |\n| **Winston** | Advanced logging system |\n| **Node.js 18+** | Modern JavaScript runtime |\n\n## 📦 Prerequisites\n\n- **Node.js**: v18.0.0 or higher\n- **PostgreSQL**: v14 or higher\n- **npm**: v9.0.0 or higher\n- **Discord Application**: [Create here](https://discord.com/developers/applications)\n\n### Required Bot Permissions\n```\n- View Channels\n- Send Messages\n- Embed Links\n- Attach Files\n- Manage Messages\n- Manage Roles\n- Manage Channels\n- Use External Emojis\n- Add Reactions\n- Read Message History\n- Connect (for voice XP)\n- Move Members\n- Moderate Members\n```\n\n## 🚀 Installation\n\n### 1. Clone Repository\n```bash\ngit clone https://github.com/cptcr/pegasus.git\ncd pegasus\n```\n\n### 2. Install Dependencies\n```bash\nnpm install\n```\n\n### 3. Database Setup\nCreate a PostgreSQL database:\n```sql\nCREATE DATABASE pegasus;\n```\n\n### 4. Environment Configuration\nCreate `.env` file in root directory:\n```env\n# Required Configuration\nDISCORD_TOKEN=your_bot_token_here\nDISCORD_CLIENT_ID=your_application_id_here\nDATABASE_URL=postgresql://username:password@localhost:5432/pegasus\nDEVELOPER_IDS=[\"your_discord_id_here\"]\nSUPPORT_SERVER_INVITE=https://discord.gg/your_invite\n\n# Optional Configuration\nNODE_ENV=development\nDEFAULT_LANGUAGE=en\nLOG_LEVEL=info\n\n# Security (Generate a 32-character key)\nENCRYPTION_KEY=your_32_character_encryption_key_here\n\n# Optional Services\nREDIS_URL=redis://localhost:6379\nSTEAM_API_KEY=your_steam_api_key\n```\n\n### 5. Build Project\n```bash\nnpm run build\n```\n\n### 6. Start Bot\n```bash\n# Production\nnpm start\n\n# Development (with auto-reload)\nnpm run dev\n```\n\n## ⚙️ Configuration\n\n### First-Time Setup\nAfter inviting the bot to your server:\n\n1. **Set Server Language**\n   ```\n   /config lang\n   ```\n\n2. **Configure XP System**\n   ```\n   /config xp\n   ```\n\n3. **Setup Economy**\n   ```\n   /config eco\n   ```\n\n4. **Configure Welcome Messages**\n   ```\n   /config welcome\n   ```\n\n5. **Setup Auto-Roles**\n   ```\n   /config autorole\n   ```\n\n### Database Tables (Auto-Created)\nThe bot automatically creates all required tables on first startup:\n- `users` - User profiles and preferences\n- `guilds` - Server configurations\n- `guild_settings` - Detailed server settings\n- `members` - Per-server user data\n- `warnings` - Warning records\n- `warning_automations` - Automated moderation rules\n- `economy_balances` - User balances\n- `economy_transactions` - Transaction history\n- `economy_shop_items` - Shop inventory\n- `tickets` - Support tickets\n- `ticket_panels` - Ticket panel configurations\n- `giveaways` - Giveaway data\n- `giveaway_entries` - User entries\n- `user_xp` - XP and level data\n- `xp_rewards` - Level role rewards\n- `audit_logs` - Complete action history\n\n## 📝 Commands\n\n### 🛡️ Moderation Commands\n\n| Command | Description | Permission |\n|---------|-------------|-----------|\n| `/warn create` | Issue warning with title, description, level | Moderate Members |\n| `/warn edit` | Edit existing warning via modal | Moderate Members |\n| `/warn lookup` | View specific warning by ID | Moderate Members |\n| `/warn view` | View all warnings for a user | Moderate Members |\n| `/warn automation create` | Setup automated actions | Administrator |\n| `/warn automation view` | List all automations | Administrator |\n| `/warn automation delete` | Remove automation | Administrator |\n| `/moderation ban` | Ban user with optional reason | Ban Members |\n| `/moderation kick` | Kick user with optional reason | Kick Members |\n| `/moderation timeout` | Timeout user for duration | Moderate Members |\n| `/moderation mute` | Apply the server mute role (optional duration) | Moderate Members |\n| `/moderation unmute` | Remove the mute role from a user | Moderate Members |\n| `/moderation unban \u003cuser_id\u003e` | Unban a user by ID | Ban Members |\n| `/moderation purge \u003camount\u003e` | Bulk delete recent messages | Manage Messages |\n| `/moderation lock [channel]` | Lock a text channel for @everyone | Manage Channels |\n| `/moderation unlock [channel]` | Unlock a previously locked channel | Manage Channels |\n| `/moderation slowmode \u003cseconds\u003e` | Set channel slowmode (0 disables) | Manage Channels |\n| `/moderation modlog [user]` | Display recent moderation cases | Moderate Members |\n| `/moderation case view \u003cid\u003e` | View a specific moderation case | Moderate Members |\n| `/moderation case delete \u003cid\u003e` | Delete a moderation case | Manage Guild |\n| `/moderation reset-xp` | Reset user's XP to 0 | Manage Guild |\n\n### 💰 Economy Commands\n\n| Command | Description | Cooldown |\n|---------|-------------|----------|\n| `/balance [user]` | Check balance | None |\n| `/daily` | Claim daily reward (100-500) | 24 hours |\n| `/work` | Work for money (50-200) | 1 hour |\n| `/rob \u003cuser\u003e` | Attempt to rob another user | 24 hours |\n| `/shop view` | Browse available items | None |\n| `/shop buy \u003citem\u003e` | Purchase an item | None |\n| `/shop inventory` | View your items | None |\n| `/gamble dice \u003camount\u003e` | Roll dice (1-6 vs dealer) | None |\n| `/gamble coinflip \u003camount\u003e \u003cside\u003e` | Flip coin (heads/tails) | None |\n| `/gamble slots \u003camount\u003e` | Play slot machine | None |\n| `/gamble blackjack \u003camount\u003e` | Play blackjack | None |\n| `/gamble roulette \u003camount\u003e \u003cbet\u003e` | Play roulette | None |\n\n### 🎉 Giveaway Commands\n\n| Command | Description | Permission |\n|---------|-------------|-----------|\n| `/gw start` | Advanced giveaway with modal | Manage Guild |\n| `/gw simple` | Quick giveaway setup | Manage Guild |\n| `/gw end \u003cid\u003e` | Manually end giveaway | Manage Guild |\n| `/gw reroll \u003cid\u003e` | Select new winners | Manage Guild |\n| `/gw configure \u003cid\u003e` | Edit active giveaway | Manage Guild |\n\n### 🎟️ Ticket Commands\n\n| Command | Description | Permission |\n|---------|-------------|-----------|\n| `/ticket panel create` | Design ticket panel | Manage Guild |\n| `/ticket panel load \u003cid\u003e` | Send panel to channel | Manage Guild |\n| `/ticket panel delete \u003cid\u003e` | Remove panel | Manage Guild |\n| `/ticket panel list` | View all panels | Manage Guild |\n| `/ticket claim` | Claim ticket | Support Role |\n| `/ticket close [reason]` | Close ticket | Support Role |\n| `/ticket stats` | View statistics | Manage Guild |\n\n### 📈 XP Commands\n\n| Command | Description |\n|---------|-------------|\n| `/xp rank [user]` | View rank card |\n| `/xp leaderboard` | Top 10 users |\n| `/xp configuration` | View XP settings |\n| `/xp card` | Customize rank card |\n\n### ⚙️ Configuration Commands\n\n| Command | Description | Permission |\n|---------|-------------|-----------|\n| `/config xp` | XP system settings | Manage Guild |\n| `/config eco` | Economy settings | Manage Guild |\n| `/config lang` | Server language | Manage Guild |\n| `/config welcome` | Welcome messages | Manage Guild |\n| `/config goodbye` | Goodbye messages | Manage Guild |\n| `/config autorole` | Auto-role setup | Manage Guild |\n\n### 🔧 Utility Commands\n\n| Command | Description |\n|---------|-------------|\n| `/utils help [command]` | Dynamic help menu |\n| `/utils avatar [user]` | Display avatar |\n| `/utils banner [user]` | Display banner |\n| `/utils steam \u003cprofile\u003e` | Steam profile info |\n| `/utils userinfo [user]` | User details |\n| `/utils whois \u003cuser\u003e` | Detailed lookup |\n| `/utils roleinfo \u003crole\u003e` | Role information |\n| `/utils serverinfo` | Server statistics |\n| `/utils support` | Support server link |\n| `/utils stats` | Bot statistics |\n| `/ping` | Check latency |\n\n### 🎮 Fun Commands\n\n| Command | Description |\n|---------|-------------|\n| `/fun meme` | Random meme |\n| `/fun fact` | Fun fact |\n| `/fun joke` | Random joke |\n| `/fun quote` | Inspirational quote |\n| `/fun dadjoke` | Dad joke |\n\n### 🌍 Language Commands\n\n| Command | Description |\n|---------|-------------|\n| `/language available` | List languages |\n| `/language current` | Your language |\n| `/language set \u003clang\u003e` | Change language |\n\n### 👑 Admin Commands\n\n| Command | Description | Permission |\n|---------|-------------|-----------|\n| `/blacklist user \u003cuser\u003e` | Blacklist user | Developer Only |\n| `/blacklist view` | View blacklist | Developer Only |\n| `/blacklist remove \u003cuser\u003e` | Unblacklist | Developer Only |\n\n## 🔒 Security Features\n\n### Input Validation\n- **Zod Schemas** - Runtime validation for all inputs\n- **SQL Injection Prevention** - Parameterized queries\n- **XSS Protection** - Input sanitization\n- **Rate Limiting** - Per-user and global limits\n\n### Permission System\n- **Hierarchical Permissions** - Role-based access\n- **Developer Override** - Emergency access\n- **Audit Logging** - Track all actions\n- **Blacklist System** - Block malicious users\n\n### Data Protection\n- **Encryption** - Sensitive data encryption\n- **Secure Tokens** - Environment variable storage\n- **HTTPS Only** - Secure API communications\n- **Privacy Compliance** - User data protection\n\n## 🌍 Internationalization\n\n### Supported Languages\n- 🇬🇧 **English** (en) - Default\n- 🇩🇪 **German** (de) - Deutsch\n- 🇪🇸 **Spanish** (es) - Español\n- 🇫🇷 **French** (fr) - Français\n\n### Translation Coverage\n- ✅ All command descriptions\n- ✅ All bot responses\n- ✅ Error messages\n- ✅ Embed content\n- ✅ Button/Modal text\n\n## 🚢 Deployment\n\n### Using Docker\n```dockerfile\nFROM node:18-alpine\nWORKDIR /app\nCOPY package*.json ./\nRUN npm ci --production\nCOPY . .\nRUN npm run build\nCMD [\"npm\", \"start\"]\n```\n\n### Using PM2\n```bash\nnpm install -g pm2\npm2 start dist/index.js --name pegasus\npm2 save\npm2 startup\n```\n\n### Hosting Recommendations\n- **VPS**: DigitalOcean, Linode, Vultr\n- **Cloud**: AWS EC2, Google Cloud, Azure\n- **Managed**: Railway, Heroku, Render\n\n## 🤝 Contributing\n\nWe welcome contributions! Please follow these steps:\n\n1. Fork the repository\n2. Create feature branch (`git checkout -b feature/AmazingFeature`)\n3. Commit changes (`git commit -m 'Add AmazingFeature'`)\n4. Push to branch (`git push origin feature/AmazingFeature`)\n5. Open Pull Request\n\n### Code Standards\n- TypeScript strict mode enabled\n- No production comments\n- Comprehensive error handling\n- Unit tests for new features\n\n## 📄 License\n\nThis project is licensed under the MIT License - see [LICENSE](LICENSE) file.\n\n## 💬 Support\n\n- **Discord Server**: [discord.gg/vaultscope](https://discord.gg/vaultscope)\n- **Developer**: [cptcr.dev](https://cptcr.dev)\n- **GitHub Issues**: [Report bugs](https://github.com/cptcr/pegasus/issues)\n- **Email**: support@cptcr.dev\n\n## 🙏 Acknowledgments\n\n- Discord.js team for the excellent library\n- PostgreSQL team for the robust database\n- All contributors and community members\n- Open source projects that made this possible\n\n---\n\n\u003cdiv align=\"center\"\u003e\n  \u003ch3\u003e⭐ Star this repository if you find it helpful!\u003c/h3\u003e\n  \u003cp\u003eMade with ❤️ by \u003ca href=\"https://github.com/cptcr\"\u003ecptcr\u003c/a\u003e\u003c/p\u003e\n  \u003cp\u003e\n    \u003ca href=\"https://github.com/cptcr/pegasus/stargazers\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/stars/cptcr/pegasus?style=social\" alt=\"Stars\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/cptcr/pegasus/network/members\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/forks/cptcr/pegasus?style=social\" alt=\"Forks\"\u003e\n    \u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcptcr%2Fpegasus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcptcr%2Fpegasus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcptcr%2Fpegasus/lists"}