{"id":50565476,"url":"https://github.com/bayue48/keking","last_synced_at":"2026-06-04T14:01:34.840Z","repository":{"id":352842790,"uuid":"1216829960","full_name":"bayue48/keking","owner":"bayue48","description":"keking reboot","archived":false,"fork":false,"pushed_at":"2026-05-28T06:19:09.000Z","size":6529,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-05-28T08:10:36.911Z","etag":null,"topics":["bot","discord","discord-bot","embed","music","music-bot","music-player","spotify","youtube"],"latest_commit_sha":null,"homepage":"https://bayue48.github.io/keking/","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/bayue48.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":"2026-04-21T09:19:03.000Z","updated_at":"2026-05-28T06:16:21.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/bayue48/keking","commit_stats":null,"previous_names":["bayue48/keking"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bayue48/keking","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bayue48%2Fkeking","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bayue48%2Fkeking/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bayue48%2Fkeking/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bayue48%2Fkeking/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bayue48","download_url":"https://codeload.github.com/bayue48/keking/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bayue48%2Fkeking/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33907694,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-04T02:00:06.755Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["bot","discord","discord-bot","embed","music","music-bot","music-player","spotify","youtube"],"created_at":"2026-06-04T14:01:33.790Z","updated_at":"2026-06-04T14:01:34.834Z","avatar_url":"https://github.com/bayue48.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Keking\n\nKeking is a Discord bot built with `discord.js` and TypeScript. It focuses on music playback, text-to-speech, social-link preview helpers, and a small set of utility and admin commands.\n\n## Features\n\n- Music playback from YouTube links, Spotify links, and search queries\n- Queue controls: play, skip, pause, resume, stop, shuffle, remove, clear, loop\n- Lyrics lookup through Genius\n- Text-to-speech playback in voice channels\n- Social-link preview helpers for X/Twitter, Instagram, Facebook, and Reddit links\n- NovelPia search via `/pia`\n- Utility commands such as `/help`, `/ping`, and `/server`\n- Admin health commands such as `/botstats` and `/guildinfo`\n- Optional PostgreSQL storage for guild-level operational data\n- Docker-based local or production deployment\n\n## Tech Stack\n\n- Node.js 22+\n- TypeScript\n- `discord.js`\n- `discord-player`\n- `@discordjs/voice`\n- PostgreSQL (`pg`)\n- Docker / Docker Compose\n\n## Commands\n\n### Utility\n\n- `/help` - list available commands\n- `/ping` - show gateway latency\n- `/server` - show basic server info\n\n### Music\n\n- `/play` - play a track from a URL\n- `/search` - search for a track and pick from buttons\n- `/queue` - show the current queue\n- `/now` - show the current track\n- `/pause` - pause playback\n- `/resume` - resume playback\n- `/skip` - skip the current track\n- `/stop` - stop playback and clear the queue\n- `/leave` - disconnect from voice\n- `/shuffle` - shuffle the queue\n- `/remove` - remove a track from the queue\n- `/clear` - clear queued tracks\n- `/loop` - change repeat mode\n- `/lyrics` - fetch lyrics for the current or requested song\n- `/tts` - play text-to-speech in voice\n\n### Integrations\n\n- `/pia` - search NovelPia titles\n\n### Admin\n\n- `/botstats` - show uptime, memory, ping, and voice dependency health\n- `/guildinfo` - show guild and deployment info\n\n## Social Preview Behavior\n\nWhen users post supported links in a guild text channel, Keking can reply with alternative preview-friendly versions.\n\nSupported rewrites in the current codebase:\n\n- `x.com` / `twitter.com` -\u003e `fixupx.com`\n- `instagram.com` -\u003e `kkinstagram.com`\n- `facebook.com` / `fb.watch` -\u003e `facebed.com`\n- `reddit.com` / `redd.it` -\u003e `rxddit.com`\n\nThis behavior depends on the bot being able to read guild message content.\n\n## Gateway Intents\n\nThe bot currently initializes with these intents:\n\n- `Guilds`\n- `GuildVoiceStates`\n- `GuildMessages`\n- `MessageContent`\n\n`MessageContent` is used for:\n\n- social-link preview replies\n- mention-based message replies\n\nThe current repo does not implement a Presence-based feature.\n\n## Environment Variables\n\nCreate a `.env` file based on `.env.example`.\n\nRequired:\n\n- `DISCORD_TOKEN`\n- `DISCORD_CLIENT_ID`\n\nOptional:\n\n- `DISCORD_GUILD_ID` - deploy commands to a single guild for faster iteration\n- `DATABASE_URL` - enable PostgreSQL storage\n- `POSTGRES_DB` - used by the bundled Docker Compose database\n- `POSTGRES_USER` - used by the bundled Docker Compose database\n- `POSTGRES_PASSWORD` - used by the bundled Docker Compose database\n- `YOUTUBE_COOKIES` - cookies string used by the YouTube extractor\n\nExample:\n\n```env\nDISCORD_TOKEN=your-bot-token\nDISCORD_CLIENT_ID=your-application-client-id\nDISCORD_GUILD_ID=optional-guild-id-for-faster-command-deploy\nDATABASE_URL=postgresql://postgres:password@localhost:5432/keking\nPOSTGRES_DB=keking\nPOSTGRES_USER=postgres\nPOSTGRES_PASSWORD=postgres\nYOUTUBE_COOKIES=youtube-cookies-string\n```\n\n## Local Development\n\nInstall dependencies:\n\n```bash\npnpm install\n```\n\nRun in watch mode:\n\n```bash\npnpm dev\n```\n\nBuild:\n\n```bash\npnpm build\n```\n\nStart the compiled bot:\n\n```bash\npnpm start\n```\n\n## Slash Command Deployment\n\nDeploy commands:\n\n```bash\npnpm deploy:commands\n```\n\nClear deployed commands:\n\n```bash\npnpm deploy:clear-commands\n```\n\nIf `DISCORD_GUILD_ID` is set, command deployment can target a single guild for faster updates.\n\n## Docker\n\nThis repo includes:\n\n- a multi-stage `Dockerfile`\n- a `docker-compose.yml` stack for the bot and PostgreSQL\n- restart policies\n- a Postgres healthcheck before the bot starts\n\nStart the stack:\n\n```bash\npnpm docker:up\n```\n\nCheck logs:\n\n```bash\npnpm docker:logs\n```\n\nStop the stack:\n\n```bash\npnpm docker:down\n```\n\nIf `DATABASE_URL` is omitted in Docker Compose, it defaults to the bundled `db` service.\n\n## Stored Data\n\nWhen `DATABASE_URL` is configured, the bot stores limited guild-level operational data:\n\n- guild ID\n- guild name\n- command deployment hash\n- join timestamp\n- update timestamp\n\nIt does not intentionally store message-content history in the database as part of normal operation.\n\n## Docs\n\nStatic docs live in [`docs/`](./docs), including:\n\n- landing page: [`docs/index.html`](./docs/index.html)\n- command reference: [`docs/commands.html`](./docs/commands.html)\n- privacy policy: [`docs/privacy.html`](./docs/privacy.html)\n\n## License\n\nThis project is licensed under the ISC License.\n\n## Notes\n\n- The bot syncs guild records and deploys commands when joining a guild.\n- Voice playback depends on system/runtime voice dependencies being available.\n- For managed Postgres providers, point `DATABASE_URL` at the external database and ignore the local `db` service.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbayue48%2Fkeking","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbayue48%2Fkeking","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbayue48%2Fkeking/lists"}