{"id":38230603,"url":"https://github.com/acmutd/peechi-bot","last_synced_at":"2026-01-17T01:00:35.745Z","repository":{"id":309276858,"uuid":"1035647222","full_name":"acmutd/peechi-bot","owner":"acmutd","description":"Peechi Bot","archived":false,"fork":false,"pushed_at":"2025-10-15T16:04:19.000Z","size":153,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-16T13:53:12.571Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/acmutd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-10T20:57:30.000Z","updated_at":"2025-10-15T16:04:24.000Z","dependencies_parsed_at":"2025-09-06T01:13:44.487Z","dependency_job_id":"345b4ac0-c402-4534-abf2-47305a1341c8","html_url":"https://github.com/acmutd/peechi-bot","commit_stats":null,"previous_names":["acmutd/peechi-bot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/acmutd/peechi-bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acmutd%2Fpeechi-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acmutd%2Fpeechi-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acmutd%2Fpeechi-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acmutd%2Fpeechi-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acmutd","download_url":"https://codeload.github.com/acmutd/peechi-bot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acmutd%2Fpeechi-bot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28490898,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T00:50:05.742Z","status":"ssl_error","status_checked_at":"2026-01-17T00:43:11.982Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-01-17T01:00:23.115Z","updated_at":"2026-01-17T01:00:35.707Z","avatar_url":"https://github.com/acmutd.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Peechi Bot\n\nA Discord bot built with Bun, TypeScript, Discord.js, and Firebase for server moderation and verification features.\n\n## Features\n\n- **Slash Commands**: Modern Discord slash command support\n- **Context Menus**: Right-click context menu commands\n- **Button Interactions**: Interactive button components\n- **Firebase Integration**: Configuration and data storage\n- **Verification System**: User verification workflow\n- **Report System**: User reporting functionality\n- **Logging**: Comprehensive logging system\n\n## Prerequisites\n\nBefore setting up the project, make sure you have:\n\n- [Bun](https://bun.sh) runtime installed (v1.2.20 or later)\n- A Discord application with bot token\n- Firebase project with Firestore database\n- Firebase service account key file\n\n## Installation\n\n1. **Clone the repository**\n\n   ```bash\n   git clone https://github.com/acmutd/peechi-bot.git\n   cd peechi-bot\n   ```\n\n2. **Install dependencies**\n\n   ```bash\n   bun install\n   ```\n\n## Configuration\n\n### 1. Environment Variables\n\nCreate a `.env` file in the root directory with the following variables:\n\n```env\n# Discord Configuration\nDISCORD_TOKEN=your_discord_bot_token\nGUILD_ID=your_discord_guild_id\nCLIENT_ID=your_discord_application_client_id\n\n# Firebase Configuration\nFIRESTORE_PROJECT_ID=your_firebase_project_id\nFIRESTORE_KEY_FILENAME=path/to/your/firebase-service-account-key.json\n\nCALENDAR_API_KEY=your_calendar_api_key\nCALENDAR_ID=you_know_what\n```\n\n### 2. Discord Bot Setup\n\n1. Go to the [Discord Developer Portal](https://discord.com/developers/applications)\n2. Create a new application or use an existing one\n3. Go to the \"Bot\" section and create a bot\n4. Copy the bot token and add it to your `.env` file as `DISCORD_TOKEN`\n5. Copy the application ID and add it to your `.env` file as `CLIENT_ID`\n6. Get your Discord server (guild) ID and add it to your `.env` file as `GUILD_ID`\n\n**Required Bot Permissions:**\n\n- Send Messages\n- Use Slash Commands\n- Manage Messages\n- Read Message History\n- Manage Roles (if using verification features)\n\n### 3. Firebase Setup\n\n1. Create a Firebase project at [Firebase Console](https://console.firebase.google.com)\n2. Enable Firestore Database\n3. Generate a service account key:\n   - Go to Project Settings → Service Accounts\n   - Click \"Generate new private key\"\n   - Save the JSON file securely\n   - Add the file path to your `.env` file as `FIRESTORE_KEY_FILENAME`\n\n### 4. Firebase Configuration Document\n\nCreate a configuration document in your Firestore database:\n\n**Collection:** `config`\n**Document ID:** `environment`\n**Document Structure:**\n\n```json\n{\n  \"ROLES\": {\n    \"VERIFIED\": \"role_id_for_verified_users\"\n  },\n  \"CHANNELS\": {\n    \"VERIFICATION\": \"channel_id_for_verification\",\n    \"ADMIN\": \"channel_id_for_admin_notifications\",\n    \"ERROR\": \"channel_id_for_error_logs\"\n  }\n}\n```\n\nReplace the IDs with actual Discord role and channel IDs from your server.\n\n## Usage\n\n### Development\n\nRun the bot in development mode with auto-reload:\n\n```bash\nbun run dev\n```\n\n### Production\n\n1. **Start the bot**\n\n   ```bash\n   bun start\n   ```\n\n### Available Scripts\n\n- `bun run dev` - Run in development mode with file watching\n- `bun run build` - Build the project to `dist/` directory\n- `bun start` - Run the built production version\n\n## Project Structure\n\n```bash\n\nsrc/\n├── bot/           # Main bot class and initialization\n├── buttons/       # Button interaction handlers\n├── commands/      # Slash commands\n├── constants/     # Bot configuration constants\n├── ctx-menus/     # Context menu commands\n├── db/           # Database services (Firebase)\n├── events/        # Discord event handlers\n├── types/         # TypeScript type definitions\n└── utils/         # Utility functions and services\n```\n\n## Commands\n\nThe bot includes several built-in commands:\n\n- `/ping` - Check bot responsiveness\n- `/verify` - User verification command\n- `/fail` - Testing/debugging command\n- `/recache` - Recache the environment variables\n- `/points` - Check your points or view the leaderboard\n- `/calendar-sync` - Sync Google Calendar events to Discord guild events\n\n## Adding New Features\n\n### Adding a Slash Command\n\n1. Create a new file in `src/commands/`\n2. Export a command object with `data` and `execute` properties:\n\n```typescript\nimport { SlashCommandBuilder } from 'discord.js'\nimport type { Command } from '../types'\n\nexport const myCommand: Command = {\n  data: new SlashCommandBuilder().setName('mycommand').setDescription('Description of my command'),\n  async execute(interaction) {\n    await interaction.reply('Hello from my command!')\n  },\n}\n```\n\n### Adding a Button Handler\n\n1. Create a new file in `src/buttons/`\n2. Export a button object with `baseId` and `execute` properties:\n\n```typescript\nimport type { ButtonCommand } from '../types'\n\nexport const myButton: ButtonCommand = {\n  baseId: 'my_button',\n  async execute(interaction) {\n    await interaction.reply('Button clicked!')\n  },\n}\n```\n\n### Adding an Event Handler\n\n1. Create a new file in `src/events/`\n2. Export event properties:\n\n```typescript\nimport type { Events } from 'discord.js'\n\nexport const name = Events.MessageCreate\nexport const once = false\n\nexport async function execute(message) {\n  // Handle the event\n}\n```\n\n## Error Handling\n\nThe bot includes comprehensive error handling and logging:\n\n- All errors are logged to the console and error channel\n- Critical errors trigger graceful shutdowns\n- Failed command/event loading is logged but doesn't crash the bot\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Test thoroughly\n5. Submit a pull request\n\n## Troubleshooting\n\n### Common Issues\n\n**\"Environment initialization failed\"**\n\n- Check that all required environment variables are set\n- Verify Firebase service account key file exists and is readable\n- Ensure Firestore database is properly configured\n\n**\"Commands not deploying\"**\n\n- Verify `DISCORD_TOKEN`, `CLIENT_ID`, and `GUILD_ID` are correct\n- Check bot permissions in Discord server\n- Ensure bot is invited to the server with proper scopes\n\n**\"Firebase connection failed\"**\n\n- Verify `FIRESTORE_PROJECT_ID` matches your Firebase project\n- Check service account key file permissions\n- Ensure Firestore is enabled in Firebase console\n\n### Logs\n\nCheck the console output for detailed error messages. The bot uses structured logging with different severity levels (info, warn, error, critical).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facmutd%2Fpeechi-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facmutd%2Fpeechi-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facmutd%2Fpeechi-bot/lists"}