@serverkgg/bridge 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/package.json +1 -1
  2. package/src/bot/botCauses.test.ts +284 -0
  3. package/src/bot/botCauses.ts +58 -0
  4. package/src/bot/botDeploy.test.ts +260 -1
  5. package/src/bot/botDeploy.ts +125 -6
  6. package/src/bot/botState.ts +6 -0
  7. package/src/bot/detect/botInspectWarning.ts +3 -1
  8. package/src/bot/detect/botPackageManager.ts +3 -0
  9. package/src/bot/detect/corpus/alexmubarakshin-ts-telegraf-boilerplate.json +37 -0
  10. package/src/bot/detect/corpus/alsarmad-discord-quran-bot.json +40 -0
  11. package/src/bot/detect/corpus/anasty17-mirror-leech-telegram-bot.json +50 -0
  12. package/src/bot/detect/corpus/anidiotsguide-guidebot.json +36 -0
  13. package/src/bot/detect/corpus/anonymousx1025-anonxmusic.json +45 -0
  14. package/src/bot/detect/corpus/bot-base-telegram-bot-template.json +35 -0
  15. package/src/bot/detect/corpus/bracketed-templates-discordjs.json +40 -0
  16. package/src/bot/detect/corpus/cog-creators-red-discordbot.json +49 -0
  17. package/src/bot/detect/corpus/cranberriez-discord.ts-bot-template.json +35 -0
  18. package/src/bot/detect/corpus/crazycat256-nextcord-bot-template.json +38 -0
  19. package/src/bot/detect/corpus/discord-tickets-bot.json +45 -0
  20. package/src/bot/detect/corpus/edjopato-telegram-typescript-bot-template.json +37 -0
  21. package/src/bot/detect/corpus/haniali3161-bot-adhkar-telegram.json +33 -0
  22. package/src/bot/detect/corpus/hellosverre-discord-ts-template.json +34 -0
  23. package/src/bot/detect/corpus/kevinnovak-discord-bot-typescript-template.json +43 -0
  24. package/src/bot/detect/corpus/kkrypt0nn-python-discord-bot-template.json +41 -0
  25. package/src/bot/detect/corpus/kolezka-telegram-grammy-template.json +37 -0
  26. package/src/bot/detect/corpus/latand-tgbot_template_v3.json +37 -0
  27. package/src/bot/detect/corpus/mahmoudbm77-zekr-telegram-bot.json +36 -0
  28. package/src/bot/detect/corpus/mericcan41-discordjs-v14-template-ts.json +33 -0
  29. package/src/bot/detect/corpus/modmail-dev-modmail.json +52 -0
  30. package/src/bot/detect/corpus/nezdemkovski-telegram-bot-boilerplate.json +39 -0
  31. package/src/bot/detect/corpus/notchum-discord-bot-template.json +39 -0
  32. package/src/bot/detect/corpus/python-discord-bot.json +44 -0
  33. package/src/bot/detect/corpus/python-telegram-bot-rules-bot.json +39 -0
  34. package/src/bot/detect/corpus/rajdave69-pycord-bot-template.json +31 -0
  35. package/src/bot/detect/corpus/rapptz-robodanny.json +36 -0
  36. package/src/bot/detect/corpus/ry2x-typescript-discord.js-v.14-template.json +35 -0
  37. package/src/bot/detect/corpus/saiteja-madha-discord-js-bot.json +45 -0
  38. package/src/bot/detect/corpus/seegreatness-discord.js-for-heroku.json +37 -0
  39. package/src/bot/detect/corpus/serverk-discord-node.json +36 -0
  40. package/src/bot/detect/corpus/serverk-discord-python.json +35 -0
  41. package/src/bot/detect/corpus/serverk-telegram-node.json +36 -0
  42. package/src/bot/detect/corpus/serverk-telegram-python.json +35 -0
  43. package/src/bot/detect/corpus/shuruhatik-quran-radio-bot-discord.json +33 -0
  44. package/src/bot/detect/corpus/skyra-project-skyra.json +46 -0
  45. package/src/bot/detect/corpus/tgbot-collection-ytdlbot.json +41 -0
  46. package/src/bot/detect/corpus/zeriodev-music-bot.json +38 -0
  47. package/src/bot/detect/detect.corpus.test.ts +77 -0
  48. package/src/bot/detect/detect.test.ts +414 -17
  49. package/src/bot/detect/detect.ts +347 -36
  50. package/src/bot/detect/detectResult.ts +4 -0
  51. package/src/bot/detect/detectTable.test.ts +22 -6
  52. package/src/bot/detect/detectTable.ts +187 -19
  53. package/src/bot/detect/detectedVersion.ts +5 -0
  54. package/src/bot/detect/envExample.test.ts +55 -1
  55. package/src/bot/detect/envExample.ts +14 -0
  56. package/src/bot/detect/index.ts +1 -0
  57. package/src/bot/detect/keys.test.ts +32 -1
  58. package/src/bot/detect/keys.ts +15 -0
  59. package/src/bot/detect/serverkJson.test.ts +2 -0
  60. package/src/bot/detect/serverkJson.ts +4 -1
  61. package/src/bot/index.ts +1 -0
  62. package/src/manifest/manifest.ts +2 -1
  63. package/src/modules/bridge.ts +2 -0
  64. package/src/modules/bridgeModule.ts +5 -0
  65. package/src/protocol/bridgeCrash.ts +49 -0
  66. package/src/protocol/bridgeEvents.ts +9 -0
  67. package/src/runtime/bridgeDriver.test.ts +45 -0
  68. package/src/runtime/bridgeDriver.ts +25 -0
  69. package/src/runtime/bridgeEvents.ts +2 -0
  70. package/src/runtime/bridgeSupervisor.test.ts +163 -3
  71. package/src/runtime/bridgeSupervisor.ts +42 -1
  72. package/src/runtime/serve.ts +26 -5
@@ -0,0 +1,31 @@
1
+ {
2
+ "source": {
3
+ "url": "https://github.com/Rajdave69/pycord-bot-template",
4
+ "branch": "main",
5
+ "commit": "9f5a87a7b8c45dbedc591afd69783258c1f91cf5",
6
+ "stars": 3
7
+ },
8
+ "files": [
9
+ "LICENSE",
10
+ "README.md",
11
+ "backend.py",
12
+ "bot.py",
13
+ "requirements.txt"
14
+ ],
15
+ "contents": {
16
+ "requirements.txt": "# _____ _ _ ____ _ _______ _ _\n# | __ \\(_) | | | _ \\ | | |__ __| | | | |\n# | | | |_ ___ ___ ___ _ __ __| | | |_) | ___ | |_ | | ___ _ __ ___ _ __ | | __ _| |_ ___\n# | | | | / __|/ __/ _ \\| '__/ _` | | _ < / _ \\| __| | |/ _ \\ '_ ` _ \\| '_ \\| |/ _` | __/ _ \\\n# | |__| | \\__ \\ (_| (_) | | | (_| | | |_) | (_) | |_ | | __/ | | | | | |_) | | (_| | || __/\n# |_____/|_|___/\\___\\___/|_| \\__,_| |____/ \\___/ \\__| |_|\\___|_| |_| |_| .__/|_|\\__,_|\\__\\___|\n# | |\n# |_|\n#\n# Welcome to Raj's Discord Bot Template\n#\n# This template is designed to be a starting point for your own Discord bot.\n# Made by RajDave69 on GitHub.\n#\n#\n# This is the requirements.txt file.\n# It contains all the modules that are required for the bot to run.\n# You can install all the modules by running the command \"pip install -r requirements.txt\"\n#\n\n\ncolorlog==6.7.0\npy-cord>=2.3.1\n"
17
+ },
18
+ "expected": {
19
+ "runtime": "python",
20
+ "packageManager": "pip",
21
+ "framework": "py-cord",
22
+ "platform": "discord",
23
+ "install": "uv pip install -r requirements.txt",
24
+ "build": null,
25
+ "start": "python bot.py",
26
+ "nodeVersion": null,
27
+ "pythonVersion": null,
28
+ "tokenKey": null,
29
+ "warnings": []
30
+ }
31
+ }
@@ -0,0 +1,36 @@
1
+ {
2
+ "source": {
3
+ "url": "https://github.com/Rapptz/RoboDanny",
4
+ "branch": "rewrite",
5
+ "commit": "1cb350899b1aaab7f6445d0180f9f878b02d0a33",
6
+ "stars": 817
7
+ },
8
+ "files": [
9
+ ".gitignore",
10
+ "LICENSE.txt",
11
+ "README.md",
12
+ "bot.py",
13
+ "launcher.py",
14
+ "pyproject.toml",
15
+ "requirements.txt"
16
+ ],
17
+ "contents": {
18
+ "pyproject.toml": "[tool.black]\nline-length = 125\nskip-string-normalization = true\n\n[tool.isort]\nprofile = \"black\"\ncombine_as_imports = true\ncombine_star = true\nline_length = 125\n\n[tool.pyright]\nreportUnnecessaryTypeIgnoreComment = \"warning\"\npythonVersion = \"3.8\"\ntypeCheckingMode = \"basic\"\nstrictParameterNoneValue = false\ninclude = [\n \"cogs\",\n \"cogs/utils\"\n]\nexclude = [\n \"**/__pycache__\",\n \"build\",\n \"dist\"\n]\n",
19
+ "requirements.txt": "discord.py[speed]>=2.3.1\ngit+https://github.com/Rapptz/discord-ext-menus@fbb8803779373357e274e1540b368365fd9d8074\nlxml\npsutil\nasyncpg>=0.12.0\ntyping_extensions>=4,<5\nclick\nparsedatetime\nlru_dict\npython-dateutil\npygit2\nmmh3\n"
20
+ },
21
+ "expected": {
22
+ "runtime": "python",
23
+ "packageManager": "pip",
24
+ "framework": "discord-py",
25
+ "platform": "discord",
26
+ "install": "uv pip install -r requirements.txt",
27
+ "build": null,
28
+ "start": "python bot.py",
29
+ "nodeVersion": null,
30
+ "pythonVersion": null,
31
+ "tokenKey": null,
32
+ "warnings": [
33
+ "unpinned-requirements"
34
+ ]
35
+ }
36
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "source": {
3
+ "url": "https://github.com/ry2x/TypeScript-Discord.js-v.14-template",
4
+ "branch": "main",
5
+ "commit": "7e148cf82234416296ea2c6b53313189e5e43a5b",
6
+ "stars": 0
7
+ },
8
+ "files": [
9
+ ".gitignore",
10
+ ".prettierignore",
11
+ ".prettierrc.json",
12
+ "README.md",
13
+ "eslint.config.mjs",
14
+ "package.json",
15
+ "pnpm-lock.yaml",
16
+ "src/index.ts",
17
+ "tsconfig.json"
18
+ ],
19
+ "contents": {
20
+ "package.json": "{\n \"type\": \"module\",\n \"packageManager\": \"pnpm@10.0.0+sha256.43abf6e720fb7bc53c591b0862605c7d323d0a9d2dd33bcac07b062e13cf4948\",\n \"lint-staged\": {\n \"*.ts\": \"eslint --cache --fix\",\n \"*.{ts,css,md}\": \"prettier --write\"\n },\n \"scripts\": {\n \"prepare\": \"husky install\",\n \"lint\": \"eslint --cache --fix src\",\n \"prettier\": \"prettier --write src\",\n \"compile\": \"tsc && pnpm run copy\",\n \"copy\": \"npx copyfiles -u 1 src/.env src/**/*.json dist/\",\n \"start\": \"pnpm run compile && cd dist &&node index.js\",\n \"clean\": \"npx rimraf dist\"\n },\n \"dependencies\": {\n \"@discordjs/rest\": \"^2.4.2\",\n \"discord.js\": \"^14.17.3\",\n \"dotenv\": \"^16.4.7\",\n \"pino\": \"^9.6.0\",\n \"pino-pretty\": \"^13.0.0\"\n },\n \"devDependencies\": {\n \"@eslint/js\": \"^9.18.0\",\n \"@tsconfig/node20\": \"^20.1.4\",\n \"@types/eslint-config-prettier\": \"^6.11.3\",\n \"eslint\": \"^9.18.0\",\n \"eslint-config-prettier\": \"^10.0.1\",\n \"eslint-import-resolver-typescript\": \"^3.7.0\",\n \"eslint-plugin-import\": \"^2.31.0\",\n \"eslint-plugin-unused-imports\": \"^4.1.4\",\n \"husky\": \"^8.0.3\",\n \"lint-staged\": \"^15.4.1\",\n \"prettier\": \"^3.4.2\",\n \"ts-node\": \"^10.9.2\",\n \"typescript\": \"^5.7.3\",\n \"typescript-eslint\": \"^8.21.0\"\n }\n}\n"
21
+ },
22
+ "expected": {
23
+ "runtime": "node",
24
+ "packageManager": "pnpm",
25
+ "framework": "discord-js",
26
+ "platform": "discord",
27
+ "install": "corepack pnpm install --frozen-lockfile",
28
+ "build": null,
29
+ "start": "pnpm run compile && cd dist &&node index.js",
30
+ "nodeVersion": null,
31
+ "pythonVersion": null,
32
+ "tokenKey": null,
33
+ "warnings": []
34
+ }
35
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "source": {
3
+ "url": "https://github.com/saiteja-madha/discord-js-bot",
4
+ "branch": "main",
5
+ "commit": "4ecd8c7b03165f70c7cf3db3a22935e14fcad0e7",
6
+ "stars": 816
7
+ },
8
+ "files": [
9
+ ".dockerignore",
10
+ ".env.example",
11
+ ".eslintrc.json",
12
+ ".gitattributes",
13
+ ".gitbook.yaml",
14
+ ".gitignore",
15
+ ".prettierrc.json",
16
+ ".replit",
17
+ "LICENSE",
18
+ "README.md",
19
+ "bot.js",
20
+ "config.js",
21
+ "docker-compose.yml",
22
+ "dockerfile",
23
+ "jsconfig.json",
24
+ "package-lock.json",
25
+ "package.json",
26
+ "replit.nix"
27
+ ],
28
+ "contents": {
29
+ ".env.example": "@@ -1,23 +0,0 @@\n# Bot Token [Required]\nBOT_TOKEN=\n\n# Mongo Database Connection String [Required]\nMONGO_CONNECTION=\n\n# Webhooks [Optional]\nERROR_LOGS=\nJOIN_LEAVE_LOGS=\n\n# Dashboard [Required for dashboard]\nBOT_SECRET=\nSESSION_PASSWORD=\n\n# Required for Weather Command (https://weatherstack.com)\nWEATHERSTACK_KEY=\n\n# Required for image commands (https://strangeapi.fun/docs)\nSTRANGE_API_KEY=\n\n# SPOTFIY [Required for Spotify Support]\nSPOTIFY_CLIENT_ID=\nSPOTIFY_CLIENT_SECRET=",
30
+ "package.json": "{\n \"name\": \"discord-js-bot\",\n \"version\": \"5.6.0\",\n \"description\": \"An open-source, multipurpose discord bot built using discord-js\",\n \"main\": \"bot.js\",\n \"author\": \"Sai Teja M\",\n \"license\": \"MIT\",\n \"engines\": {\n \"node\": \">=18.0.0\"\n },\n \"scripts\": {\n \"dev\": \"nodemon .\",\n \"start\": \"node .\",\n \"format\": \"prettier --write src\",\n \"docker:package\": \"tar -cf discord-js-bot.tar dashboard logs src bot.js config.js dockerfile package.json package-lock.json\",\n \"docker:build\": \"docker build -t saitejamadha/discord-js-bot:5.6.0 .\"\n },\n \"homepage\": \"https://github.com/saiteja-madha/discord-js-bot#readme\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/saiteja-madha/discord-js-bot.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/saiteja-madha/discord-js-bot/issues\"\n },\n \"dependencies\": {\n \"@lavaclient/queue\": \"^2.1.1\",\n \"@lavaclient/spotify\": \"^3.1.0\",\n \"@vitalets/google-translate-api\": \"^9.2.1\",\n \"ascii-table\": \"0.0.9\",\n \"btoa\": \"^1.2.1\",\n \"common-tags\": \"^1.8.2\",\n \"connect-mongo\": \"^5.1.0\",\n \"country-emoji-languages\": \"^1.0.1\",\n \"discord-giveaways\": \"^6.0.1\",\n \"discord-together\": \"^1.3.31\",\n \"discord.js\": \"^14.14.1\",\n \"dotenv\": \"^16.4.7\",\n \"ejs\": \"^3.1.10\",\n \"enhanced-ms\": \"^2.3.0\",\n \"express\": \"^4.21.2\",\n \"express-session\": \"^1.18.1\",\n \"fixedsize-map\": \"^1.1.0\",\n \"iso-639-1\": \"^3.1.4\",\n \"lavaclient\": \"^4.1.1\",\n \"module-alias\": \"^2.2.3\",\n \"moment\": \"^2.30.1\",\n \"mongoose\": \"^8.9.5\",\n \"nekos.life\": \"^3.0.0\",\n \"node-fetch\": \"^2.7.0\",\n \"os\": \"^0.1.2\",\n \"pino\": \"^8.21.0\",\n \"pino-pretty\": \"^10.3.1\",\n \"pretty-ms\": \"^7.0.1\",\n \"snakecord\": \"^1.0.9\",\n \"sourcebin_js\": \"^0.0.3-ignore\",\n \"string-progressbar\": \"^1.0.4\",\n \"table\": \"^6.9.0\",\n \"timestamp-to-date\": \"^1.1.0\",\n \"twemoji-parser\": \"^14.0.0\"\n },\n \"optionalDependencies\": {\n \"bufferutil\": \"^4.0.9\",\n \"erlpack\": \"^0.1.4\",\n \"utf-8-validate\": \"^6.0.5\",\n \"zlib-sync\": \"^0.1.9\"\n },\n \"devDependencies\": {\n \"eslint\": \"^8.57.1\",\n \"eslint-plugin-jsdoc\": \"^46.10.1\",\n \"node\": \"^18.20.6\",\n \"nodemon\": \"^3.1.9\",\n \"prettier\": \"3.4.2\"\n },\n \"keywords\": [\n \"discord\",\n \"discord.js\",\n \"discord-bot\",\n \"open-source\",\n \"bot\",\n \"multipurpose\",\n \"multi-purpose-bot\"\n ],\n \"_moduleAliases\": {\n \"@root\": \".\",\n \"@handlers\": \"src/handlers/\",\n \"@helpers\": \"src/helpers/\",\n \"@schemas\": \"src/database/schemas/\",\n \"@src\": \"src/\",\n \"@structures\": \"src/structures/\"\n }\n}\n"
31
+ },
32
+ "expected": {
33
+ "runtime": "node",
34
+ "packageManager": "npm",
35
+ "framework": "discord-js",
36
+ "platform": "discord",
37
+ "install": "npm ci",
38
+ "build": null,
39
+ "start": "node .",
40
+ "nodeVersion": "18",
41
+ "pythonVersion": null,
42
+ "tokenKey": "BOT_TOKEN",
43
+ "warnings": []
44
+ }
45
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "source": {
3
+ "url": "https://github.com/SeeGreatness/discord.js-for-heroku",
4
+ "branch": "master",
5
+ "commit": "73ce934295b8be228846e01bce2f4a1321cde184",
6
+ "stars": 1
7
+ },
8
+ "files": [
9
+ ".gitignore",
10
+ "LICENSE",
11
+ "Procfile",
12
+ "README.md",
13
+ "fork?",
14
+ "index.js",
15
+ "package.json"
16
+ ],
17
+ "contents": {
18
+ "Procfile": "worker: npm start\n",
19
+ "package.json": "{\n \"name\": \"discord.js-heroku\",\n \"version\": \"1.0.0\",\n \"description\": \"An in-depth guide on deploying your Discord.js bot on Heroku\",\n \"main\": \"index.js\",\n \"engines\": {\n \"node\": \"8.x\",\n \"npm\": \"*\"\n },\n \"scripts\": {\n \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\",\n \"start\": \"node index.js\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/synicalsyntax/discord.js-heroku.git\"\n },\n \"keywords\": [\n \"heroku\",\n \"discord.js\"\n ],\n \"author\": \"synicalsyntax\",\n \"license\": \"MIT\",\n \"bugs\": {\n \"url\": \"https://github.com/synicalsyntax/discord.js-heroku/issues\"\n },\n \"homepage\": \"https://github.com/synicalsyntax/discord.js-heroku#readme\",\n \"dependencies\": {\n \"discord.js\": \"^11.3.0\"\n }\n}\n"
20
+ },
21
+ "expected": {
22
+ "runtime": "node",
23
+ "packageManager": "npm",
24
+ "framework": "discord-js",
25
+ "platform": "discord",
26
+ "install": "npm install",
27
+ "build": null,
28
+ "start": "npm start",
29
+ "nodeVersion": "8",
30
+ "pythonVersion": null,
31
+ "tokenKey": null,
32
+ "warnings": [
33
+ "no-lockfile",
34
+ "node-version-unmet"
35
+ ]
36
+ }
37
+ }
@@ -0,0 +1,36 @@
1
+ {
2
+ "source": {
3
+ "url": "https://github.com/serverkgg/bot-node/tree/main/templates/discord-node",
4
+ "branch": "main",
5
+ "commit": "3f9f6c033824857a9ffd849421fc5ecff31500d7",
6
+ "stars": null
7
+ },
8
+ "files": [
9
+ ".env.example",
10
+ ".gitignore",
11
+ "LICENSE",
12
+ "README.md",
13
+ "index.js",
14
+ "package-lock.json",
15
+ "package.json",
16
+ "serverk.json"
17
+ ],
18
+ "contents": {
19
+ ".env.example": "DISCORD_TOKEN=\n",
20
+ "package.json": "{\n\t\"name\": \"discord-bot\",\n\t\"version\": \"1.0.0\",\n\t\"private\": true,\n\t\"type\": \"module\",\n\t\"main\": \"index.js\",\n\t\"scripts\": {\n\t\t\"start\": \"node index.js\",\n\t\t\"dev\": \"node --env-file=.env index.js\"\n\t},\n\t\"engines\": {\n\t\t\"node\": \">=22\"\n\t},\n\t\"dependencies\": {\n\t\t\"discord.js\": \"^14.27.0\"\n\t}\n}\n",
21
+ "serverk.json": "{\n\t\"runtime\": \"node\",\n\t\"platform\": \"discord\",\n\t\"framework\": \"discord-js\",\n\t\"env\": [\n\t\t{\n\t\t\t\"key\": \"DISCORD_TOKEN\",\n\t\t\t\"sensitive\": true\n\t\t}\n\t]\n}\n"
22
+ },
23
+ "expected": {
24
+ "runtime": "node",
25
+ "packageManager": "npm",
26
+ "framework": "discord-js",
27
+ "platform": "discord",
28
+ "install": "npm ci",
29
+ "build": null,
30
+ "start": "node index.js",
31
+ "nodeVersion": "22",
32
+ "pythonVersion": null,
33
+ "tokenKey": "DISCORD_TOKEN",
34
+ "warnings": []
35
+ }
36
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "source": {
3
+ "url": "https://github.com/serverkgg/bot-python/tree/main/templates/discord-python",
4
+ "branch": "main",
5
+ "commit": "0a623a9dc114e31f0f2a5011e1f0471b2c047df3",
6
+ "stars": null
7
+ },
8
+ "files": [
9
+ ".env.example",
10
+ ".gitignore",
11
+ "LICENSE",
12
+ "README.md",
13
+ "main.py",
14
+ "requirements.txt",
15
+ "serverk.json"
16
+ ],
17
+ "contents": {
18
+ ".env.example": "DISCORD_TOKEN=\n",
19
+ "requirements.txt": "aiohappyeyeballs==2.7.1\naiohttp==3.14.3\naiosignal==1.4.0\nattrs==26.1.0\ndiscord.py==2.7.1\nfrozenlist==1.8.0\nidna==3.20\nmultidict==6.9.1\npropcache==0.5.4\ntyping_extensions==4.16.0\nyarl==1.25.1\n",
20
+ "serverk.json": "{\n\t\"runtime\": \"python\",\n\t\"platform\": \"discord\",\n\t\"framework\": \"discord-py\",\n\t\"env\": [\n\t\t{\n\t\t\t\"key\": \"DISCORD_TOKEN\",\n\t\t\t\"sensitive\": true\n\t\t}\n\t]\n}\n"
21
+ },
22
+ "expected": {
23
+ "runtime": "python",
24
+ "packageManager": "pip",
25
+ "framework": "discord-py",
26
+ "platform": "discord",
27
+ "install": "uv pip install -r requirements.txt",
28
+ "build": null,
29
+ "start": "python main.py",
30
+ "nodeVersion": null,
31
+ "pythonVersion": null,
32
+ "tokenKey": "DISCORD_TOKEN",
33
+ "warnings": []
34
+ }
35
+ }
@@ -0,0 +1,36 @@
1
+ {
2
+ "source": {
3
+ "url": "https://github.com/serverkgg/bot-node/tree/main/templates/telegram-node",
4
+ "branch": "main",
5
+ "commit": "3f9f6c033824857a9ffd849421fc5ecff31500d7",
6
+ "stars": null
7
+ },
8
+ "files": [
9
+ ".env.example",
10
+ ".gitignore",
11
+ "LICENSE",
12
+ "README.md",
13
+ "index.js",
14
+ "package-lock.json",
15
+ "package.json",
16
+ "serverk.json"
17
+ ],
18
+ "contents": {
19
+ ".env.example": "TELEGRAM_TOKEN=\n",
20
+ "package.json": "{\n\t\"name\": \"telegram-bot\",\n\t\"version\": \"1.0.0\",\n\t\"private\": true,\n\t\"type\": \"module\",\n\t\"main\": \"index.js\",\n\t\"scripts\": {\n\t\t\"start\": \"node index.js\",\n\t\t\"dev\": \"node --env-file=.env index.js\"\n\t},\n\t\"engines\": {\n\t\t\"node\": \">=22\"\n\t},\n\t\"dependencies\": {\n\t\t\"grammy\": \"^1.46.0\"\n\t}\n}\n",
21
+ "serverk.json": "{\n\t\"runtime\": \"node\",\n\t\"platform\": \"telegram\",\n\t\"framework\": \"grammy\",\n\t\"env\": [\n\t\t{\n\t\t\t\"key\": \"TELEGRAM_TOKEN\",\n\t\t\t\"sensitive\": true\n\t\t}\n\t]\n}\n"
22
+ },
23
+ "expected": {
24
+ "runtime": "node",
25
+ "packageManager": "npm",
26
+ "framework": "grammy",
27
+ "platform": "telegram",
28
+ "install": "npm ci",
29
+ "build": null,
30
+ "start": "node index.js",
31
+ "nodeVersion": "22",
32
+ "pythonVersion": null,
33
+ "tokenKey": "TELEGRAM_TOKEN",
34
+ "warnings": []
35
+ }
36
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "source": {
3
+ "url": "https://github.com/serverkgg/bot-python/tree/main/templates/telegram-python",
4
+ "branch": "main",
5
+ "commit": "0a623a9dc114e31f0f2a5011e1f0471b2c047df3",
6
+ "stars": null
7
+ },
8
+ "files": [
9
+ ".env.example",
10
+ ".gitignore",
11
+ "LICENSE",
12
+ "README.md",
13
+ "main.py",
14
+ "requirements.txt",
15
+ "serverk.json"
16
+ ],
17
+ "contents": {
18
+ ".env.example": "TELEGRAM_TOKEN=\n",
19
+ "requirements.txt": "anyio==4.15.1\ncertifi==2026.7.22\nh11==0.16.0\nhttpcore==1.0.9\nhttpx==0.28.1\nidna==3.20\npython-telegram-bot==21.11.1\ntyping_extensions==4.16.0\n",
20
+ "serverk.json": "{\n\t\"runtime\": \"python\",\n\t\"platform\": \"telegram\",\n\t\"framework\": \"python-telegram-bot\",\n\t\"env\": [\n\t\t{\n\t\t\t\"key\": \"TELEGRAM_TOKEN\",\n\t\t\t\"sensitive\": true\n\t\t}\n\t]\n}\n"
21
+ },
22
+ "expected": {
23
+ "runtime": "python",
24
+ "packageManager": "pip",
25
+ "framework": "python-telegram-bot",
26
+ "platform": "telegram",
27
+ "install": "uv pip install -r requirements.txt",
28
+ "build": null,
29
+ "start": "python main.py",
30
+ "nodeVersion": null,
31
+ "pythonVersion": null,
32
+ "tokenKey": "TELEGRAM_TOKEN",
33
+ "warnings": []
34
+ }
35
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "source": {
3
+ "url": "https://github.com/Shuruhatik/quran-radio-bot-discord",
4
+ "branch": "main",
5
+ "commit": "20cf25d87ff0bc6ec1c638391df919bb75fdd20a",
6
+ "stars": 14
7
+ },
8
+ "files": [
9
+ "LICENSE",
10
+ "README.md",
11
+ "channels.js",
12
+ "index.js",
13
+ "package.json"
14
+ ],
15
+ "contents": {
16
+ "package.json": "{\n \"name\": \"quran-radio-bot-discord\",\n \"description\": \"Bot By ShuruhatikYT\",\n \"version\": \"1.0.0\",\n \"main\": \"index.js\",\n \"scripts\": {\n \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\n },\n \"keywords\": [],\n \"type\": \"module\",\n \"author\": \"shuruhatik\",\n \"license\": \"BSL-1.0 License\",\n \"dependencies\": {\n \"@discordjs/voice\": \"^0.8.0\",\n \"chalk-animation\": \"^1.6.0\",\n \"discord.js\": \"^14.0.0-dev.1649937833-b01f414\",\n \"express\": \"^4.17.3\",\n \"ffmpeg-static\": \"^5.0.0\",\n \"inquirer\": \"^8.2.2\",\n \"libsodium-wrappers\": \"^0.7.10\",\n \"nanospinner\": \"^1.1.0\",\n \"node\": \"^17.7.2\",\n \"nodemon\": \"^2.0.15\",\n \"quick.replit\": \"^1.0.3\",\n \"st.db\": \"^4.0.7\"\n }\n}\n"
17
+ },
18
+ "expected": {
19
+ "runtime": "node",
20
+ "packageManager": "npm",
21
+ "framework": "discord-js",
22
+ "platform": "discord",
23
+ "install": "npm install",
24
+ "build": null,
25
+ "start": "node index.js",
26
+ "nodeVersion": null,
27
+ "pythonVersion": null,
28
+ "tokenKey": null,
29
+ "warnings": [
30
+ "no-lockfile"
31
+ ]
32
+ }
33
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "source": {
3
+ "url": "https://github.com/skyra-project/skyra",
4
+ "branch": "main",
5
+ "commit": "9bf63c7705472a88c0ec3950ea571dab52fc92d5",
6
+ "stars": 309
7
+ },
8
+ "files": [
9
+ ".codecov.yml",
10
+ ".editorconfig",
11
+ ".eslintignore",
12
+ ".eslintrc.json",
13
+ ".gitattributes",
14
+ ".gitignore",
15
+ ".prettierignore",
16
+ ".yarnrc.yml",
17
+ "Dockerfile",
18
+ "LICENSE",
19
+ "README.md",
20
+ "crowdin.yml",
21
+ "docker-compose.yml",
22
+ "package.json",
23
+ "tsconfig.base.json",
24
+ "tsconfig.eslint.json",
25
+ "vitest.config.ts",
26
+ "yarn.lock"
27
+ ],
28
+ "contents": {
29
+ "package.json": "{\n\t\"name\": \"skyra\",\n\t\"version\": \"6.3.0\",\n\t\"description\": \"Multipurpose Discord Bot built on Sapphire Framework\",\n\t\"author\": \"Skyra Project\",\n\t\"license\": \"Apache-2.0\",\n\t\"main\": \"./dist/Skyra.js\",\n\t\"type\": \"module\",\n\t\"imports\": {\n\t\t\"#utils/common\": \"./dist/lib/util/common/index.js\",\n\t\t\"#utils/functions\": \"./dist/lib/util/functions/index.js\",\n\t\t\"#utils/resolvers\": \"./dist/lib/util/resolvers/index.js\",\n\t\t\"#utils/*\": \"./dist/lib/util/*.js\",\n\t\t\"#lib/database/entities\": \"./dist/lib/database/entities/index.js\",\n\t\t\"#lib/database/settings\": \"./dist/lib/database/settings/index.js\",\n\t\t\"#lib/database\": \"./dist/lib/database/index.js\",\n\t\t\"#lib/discord\": \"./dist/lib/discord/index.js\",\n\t\t\"#lib/moderation/actions\": \"./dist/lib/moderation/actions/index.js\",\n\t\t\"#lib/moderation/common\": \"./dist/lib/moderation/common/index.js\",\n\t\t\"#lib/moderation/managers/loggers\": \"./dist/lib/moderation/managers/loggers/index.js\",\n\t\t\"#lib/moderation/managers\": \"./dist/lib/moderation/managers/index.js\",\n\t\t\"#lib/moderation/workers\": \"./dist/lib/moderation/workers/index.js\",\n\t\t\"#lib/moderation\": \"./dist/lib/moderation/index.js\",\n\t\t\"#lib/schedule\": \"./dist/lib/schedule/index.js\",\n\t\t\"#lib/structures/data\": \"./dist/lib/structures/data/index.js\",\n\t\t\"#lib/structures/managers\": \"./dist/lib/structures/managers/index.js\",\n\t\t\"#lib/structures\": \"./dist/lib/structures/index.js\",\n\t\t\"#lib/setup\": \"./dist/lib/setup/index.js\",\n\t\t\"#lib/types\": \"./dist/lib/types/index.js\",\n\t\t\"#lib/i18n/languageKeys\": \"./dist/lib/i18n/languageKeys/index.js\",\n\t\t\"#lib/i18n\": \"./dist/lib/i18n/index.js\",\n\t\t\"#lib/*\": \"./dist/lib/*.js\",\n\t\t\"#languages\": \"./dist/languages/index.js\",\n\t\t\"#root/*\": \"./dist/*.js\"\n\t},\n\t\"scripts\": {\n\t\t\"build\": \"tsc -b src\",\n\t\t\"dev\": \"yarn build && yarn start\",\n\t\t\"watch\": \"tsc -b src -w\",\n\t\t\"watch:start\": \"tsc-watch -b src --onSuccess \\\"yarn start\\\"\",\n\t\t\"prisma:generate\": \"yarn prisma generate\",\n\t\t\"clean\": \"node scripts/build/clean.mjs\",\n\t\t\"start\": \"node --enable-source-maps dist/Skyra.js\",\n\t\t\"start:profiler:0x\": \"0x --collect-only dist/Skyra.js\",\n\t\t\"test\": \"vitest run\",\n\t\t\"lint\": \"eslint --fix --ext ts src tests\",\n\t\t\"format\": \"prettier --write --log-level=warn \\\"{src,tests}/**/*.{js,ts,json}\\\"\",\n\t\t\"scripts:tlds\": \"node scripts/tlds.mjs\",\n\t\t\"scripts:migration\": \"node scripts/migrations.mjs\",\n\t\t\"dockerps\": \"pwsh -NoLogo ./.docker/control.ps1\",\n\t\t\"update\": \"yarn upgrade-interactive\"\n\t},\n\t\"dependencies\": {\n\t\t\"@discordjs/builders\": \"^1.10.1\",\n\t\t\"@discordjs/collection\": \"^2.1.1\",\n\t\t\"@discordjs/core\": \"^1.2.0\",\n\t\t\"@influxdata/influxdb-client\": \"^1.35.0\",\n\t\t\"@influxdata/influxdb-client-apis\": \"^1.35.0\",\n\t\t\"@prisma/client\": \"^6.6.0\",\n\t\t\"@sapphire/async-queue\": \"^1.5.5\",\n\t\t\"@sapphire/bitfield\": \"^1.2.4\",\n\t\t\"@sapphire/decorators\": \"^6.1.1\",\n\t\t\"@sapphire/discord.js-utilities\": \"7.3.2\",\n\t\t\"@sapphire/fetch\": \"^3.0.5\",\n\t\t\"@sapphire/framework\": \"5.3.3\",\n\t\t\"@sapphire/iterator-utilities\": \"^2.0.1\",\n\t\t\"@sapphire/plugin-api\": \"^8.0.0\",\n\t\t\"@sapphire/plugin-editable-commands\": \"^4.0.4\",\n\t\t\"@sapphire/plugin-i18next\": \"^7.1.3\",\n\t\t\"@sapphire/plugin-logger\": \"^4.0.2\",\n\t\t\"@sapphire/plugin-subcommands\": \"^7.0.1\",\n\t\t\"@sapphire/ratelimits\": \"^2.4.11\",\n\t\t\"@sapphire/snowflake\": \"^3.5.5\",\n\t\t\"@sapphire/stopwatch\": \"^1.5.4\",\n\t\t\"@sapphire/time-utilities\": \"^1.7.14\",\n\t\t\"@sapphire/utilities\": \"^3.18.2\",\n\t\t\"@sentry/node\": \"^8.55.0\",\n\t\t\"@skyra/ai\": \"^1.2.0\",\n\t\t\"@skyra/char\": \"^1.0.3\",\n\t\t\"@skyra/env-utilities\": \"^1.3.0\",\n\t\t\"@skyra/jaro-winkler\": \"^1.1.1\",\n\t\t\"@skyra/twitch-helpers\": \"^2.0.1\",\n\t\t\"bufferutil\": \"^4.0.9\",\n\t\t\"colorette\": \"^2.0.20\",\n\t\t\"confusables\": \"^1.1.1\",\n\t\t\"diff\": \"^7.0.0\",\n\t\t\"discord-api-types\": \"^0.37.115\",\n\t\t\"discord.js\": \"~14.18.0\",\n\t\t\"he\": \"^1.2.0\",\n\t\t\"zlib-sync\": \"^0.1.9\"\n\t},\n\t\"devDependencies\": {\n\t\t\"0x\": \"^5.8.0\",\n\t\t\"@commitlint/cli\": \"^19.8.0\",\n\t\t\"@commitlint/config-conventional\": \"^19.8.0\",\n\t\t\"@sapphire/eslint-config\": \"^5.0.5\",\n\t\t\"@sapphire/prettier-config\": \"^2.0.0\",\n\t\t\"@sapphire/ts-config\": \"^5.0.1\",\n\t\t\"@types/backoff\": \"^2.5.5\",\n\t\t\"@types/diff\": \"^6.0.0\",\n\t\t\"@types/he\": \"^1.2.3\",\n\t\t\"@types/node\": \"^22.10.5\",\n\t\t\"@types/pg\": \"^8.11.12\",\n\t\t\"@types/ws\": \"^8.18.1\",\n\t\t\"@typescript-eslint/eslint-plugin\": \"^7.18.0\",\n\t\t\"@typescript-eslint/parser\": \"^7.18.0\",\n\t\t\"@vitest/coverage-v8\": \"^2.1.9\",\n\t\t\"cz-conventional-changelog\": \"^3.3.0\",\n\t\t\"eslint\": \"^8.57.1\",\n\t\t\"eslint-config-prettier\": \"^9.1.0\",\n\t\t\"eslint-plugin-prettier\": \"^5.2.6\",\n\t\t\"lint-staged\": \"^15.5.1\",\n\t\t\"prettier\": \"^3.5.3\",\n\t\t\"prisma\": \"^6.6.0\",\n\t\t\"prisma-json-types-generator\": \"^3.2.3\",\n\t\t\"tsc-watch\": \"^6.3.0\",\n\t\t\"typescript\": \"~5.7.2\",\n\t\t\"vitest\": \"^2.1.9\"\n\t},\n\t\"resolutions\": {\n\t\t\"ansi-regex\": \"^5.0.1\",\n\t\t\"discord-api-types\": \"^0.37.115\",\n\t\t\"minimist\": \"^1.2.8\"\n\t},\n\t\"engines\": {\n\t\t\"node\": \"^22.11.0\"\n\t},\n\t\"repository\": {\n\t\t\"type\": \"git\",\n\t\t\"url\": \"git+https://github.com/skyra-project/skyra.git\"\n\t},\n\t\"commitlint\": {\n\t\t\"extends\": [\n\t\t\t\"@commitlint/config-conventional\"\n\t\t]\n\t},\n\t\"lint-staged\": {\n\t\t\"*\": \"prettier --ignore-unknown --write\",\n\t\t\"*.{mjs,js,ts}\": \"eslint --fix --ext mjs,js,ts\"\n\t},\n\t\"config\": {\n\t\t\"commitizen\": {\n\t\t\t\"path\": \"./node_modules/cz-conventional-changelog\"\n\t\t}\n\t},\n\t\"prettier\": \"@sapphire/prettier-config\",\n\t\"packageManager\": \"yarn@4.9.0\",\n\t\"volta\": {\n\t\t\"node\": \"22.14.0\"\n\t}\n}\n"
30
+ },
31
+ "expected": {
32
+ "runtime": "node",
33
+ "packageManager": "yarn",
34
+ "framework": "discord-js",
35
+ "platform": "discord",
36
+ "install": "corepack yarn install --immutable",
37
+ "build": "corepack yarn run build",
38
+ "start": "node --enable-source-maps dist/Skyra.js",
39
+ "nodeVersion": "22",
40
+ "pythonVersion": null,
41
+ "tokenKey": null,
42
+ "warnings": [
43
+ "node-version-unmet"
44
+ ]
45
+ }
46
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "source": {
3
+ "url": "https://github.com/tgbot-collection/ytdlbot",
4
+ "branch": "master",
5
+ "commit": "e03e55eb250b7d90969f7f435c0ea71abc8693ad",
6
+ "stars": 727
7
+ },
8
+ "files": [
9
+ ".dockerignore",
10
+ ".env.example",
11
+ ".gitignore",
12
+ "Dockerfile",
13
+ "LICENSE",
14
+ "README.md",
15
+ "docker-compose.yml",
16
+ "pdm.lock",
17
+ "pre-push.py",
18
+ "pyproject.toml",
19
+ "requirements.txt",
20
+ "src/main.py",
21
+ "youtube-cookies.txt"
22
+ ],
23
+ "contents": {
24
+ ".env.example": "# Example .env file for ytdlbot configuration\n\n# Number of workers (default is 100)\nWORKERS=100\n\n# Telegram app ID\nAPP_ID=\n\n# Telegram app hash\nAPP_HASH=\n\n# Telegram bot token\nBOT_TOKEN=\n\n# Owner ID, comma-separated\nOWNER=\n\n# List of authorized users, comma-separated\nAUTHORIZED_USER=\n\n# Database connection address, i.e. mysql+pymysql://user:pass@mysql/dbname\nDB_DSN=mysql+pymysql://ytdlbot:your_password@mysql/ytdlbot\n\n# Redis host, leave it empty to use fakeredis\nREDIS_HOST=redis\n\n# Enable FFMPEG for video processing (True/False)\nENABLE_FFMPEG=False\n\n# Desired audio format (e.g., mp3, wav), leave it empty to use m4a\nAUDIO_FORMAT=\n\n# Enable m3u8 link support (True/False)\nM3U8_SUPPORT=False\n\n# Enable Aria2 for downloads (True/False)\nENABLE_ARIA2=False\n\n# Path to Rclone executable\nRCLONE_PATH=\n\n# Enable VIP features (True/False)\nENABLE_VIP=False\n\n# Payment provider token from Bot Father\nPROVIDER_TOKEN=\n\n# Free downloads allowed per user\nFREE_DOWNLOAD=5\n\n# Rate limit for requests\nRATE_LIMIT=120\n\n# Path for temporary files (ensure the directory exists and is writable)\nTMPFILE_PATH=\n\n# Maximum size for Telegram uploads in MB\nTG_NORMAL_MAX_SIZE=2000\n\n# Maximum URL length in captions\nCAPTION_URL_LENGTH_LIMIT=150\n\n# potoken 'https://github.com/yt-dlp/yt-dlp/wiki/PO-Token-Guide'\nPOTOKEN=11\n\nBROWSERS=firefox\n",
25
+ "pyproject.toml": "[project]\nname = \"ytdlbot\"\nversion = \"1.0.0\"\ndescription = \"Default template for PDM package\"\nauthors = [\n {name = \"Benny\", email = \"benny.think@gmail.com\"},\n]\ndependencies = [\"tgcrypto>=1.2.5\", \"yt-dlp[curl-cffi,default]==2026.1.31\", \"APScheduler>=3.11.2\", \"ffmpeg-python>=0.2.0\", \"PyMySQL>=1.1.1\", \"filetype>=1.2.0\", \"beautifulsoup4>=4.14.3\", \"fakeredis>=2.33.0\", \"redis==6.4.0\", \"requests>=2.32.5\", \"tqdm==4.67.2\", \"token-bucket>=0.3.0\", \"python-dotenv>=1.0.1\", \"black>=24.10.0\", \"sqlalchemy>=2.0.36\", \"psutil==7.2.2\", \"ffpb>=0.4.1\", \"kurigram==2.2.18\", \"cryptography>=46.0.4\", \"greenlet==3.3.1\"]\nrequires-python = \">=3.10\"\nreadme = \"README.md\"\nlicense = {text = \"Apache2.0\"}\n\n\n[tool.pdm]\ndistribution = false\n",
26
+ "requirements.txt": "tgcrypto>=1.2.5\nAPScheduler>=3.11.0\nffmpeg-python>=0.2.0\nPyMySQL>=1.1.1\nfiletype>=1.2.0\nbeautifulsoup4>=4.14.3\nfakeredis>=2.33.0\nredis==6.4.0\nrequests>=2.32.5\ntqdm>=4.67.2\ntoken-bucket>=0.3.0\npython-dotenv>=1.0.1\nblack>=24.10.0\nsqlalchemy>=2.0.36\npsutil>=7.2.2\nffpb>=0.4.1\ncryptography>=46.0.4\nkurigram==2.2.18\nyt-dlp[default,curl-cffi]==2026.1.31"
27
+ },
28
+ "expected": {
29
+ "runtime": "python",
30
+ "packageManager": "pip",
31
+ "framework": null,
32
+ "platform": null,
33
+ "install": "uv pip install -r requirements.txt",
34
+ "build": null,
35
+ "start": "python src/main.py",
36
+ "nodeVersion": null,
37
+ "pythonVersion": null,
38
+ "tokenKey": "BOT_TOKEN",
39
+ "warnings": []
40
+ }
41
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "source": {
3
+ "url": "https://github.com/ZerioDev/Music-bot",
4
+ "branch": "master",
5
+ "commit": "c373978cc5ab87dffa4b92e9121728b24d963a87",
6
+ "stars": 936
7
+ },
8
+ "files": [
9
+ ".env.example",
10
+ ".gitignore",
11
+ "LICENSE",
12
+ "README.md",
13
+ "config.js",
14
+ "loader.js",
15
+ "main.js",
16
+ "package.json",
17
+ "process_tools.js"
18
+ ],
19
+ "contents": {
20
+ ".env.example": "# This is a .env file where you should add sensitive data.\n# It is important to note that this file should not be shared or committed to version control systems, as it contains sensitive information such as API keys, passwords, and other credentials.\n# Make sure to replace the placeholders in this file with the actual sensitive data required by your application.\n# Keeping this file secure is crucial to protect your application and its data from unauthorized access.\n\n#Important!!!: This file should be renamed to .env\n\n# Discord Bot Token\nDISCORD_TOKEN=\"\"\n\n#Guild ID\nGUILD=\"\"\n",
21
+ "package.json": "{\n \"name\": \"music-bot\",\n \"main\": \"main.js\",\n \"author\": \"ZerioDev\",\n \"version\": \"8.0.0\",\n \"repository\": \"https://github.com/ZerioDev/Music-bot.git\",\n \"description\": \"A complete code to download for a cool Discord music bot.\",\n \"scripts\": {\n \"start\": \"node main.js\"\n },\n \"dependencies\": {\n \"@discord-player/extractor\": \"^4.3.1\",\n \"@discordjs/opus\": \"^0.9.0\",\n \"@distube/ytdl-core\": \"^4.11.8\",\n \"@evan/opus\": \"^1.0.3\",\n \"discord-player\": \"6.6.9-dev.1\",\n \"discord-player-youtubei\": \"^1.3.3\",\n \"discord.js\": \"^14.13.0\",\n \"dotenv\": \"^16.4.5\",\n \"ffmpeg-static\": \"^5.0.2\",\n \"ms\": \"^3.0.0-canary.1\",\n \"play-dl\": \"^1.9.6\",\n \"translate\": \"^3.0.0\"\n }\n}\n"
22
+ },
23
+ "expected": {
24
+ "runtime": "node",
25
+ "packageManager": "npm",
26
+ "framework": "discord-js",
27
+ "platform": "discord",
28
+ "install": "npm install",
29
+ "build": null,
30
+ "start": "node main.js",
31
+ "nodeVersion": null,
32
+ "pythonVersion": null,
33
+ "tokenKey": "DISCORD_TOKEN",
34
+ "warnings": [
35
+ "no-lockfile"
36
+ ]
37
+ }
38
+ }
@@ -0,0 +1,77 @@
1
+ import { describe, expect, it } from "bun:test";
2
+ import { readdirSync, readFileSync } from "node:fs";
3
+ import { join } from "node:path";
4
+ import { detect } from "./detect";
5
+
6
+ interface CorpusSource {
7
+ url: string;
8
+ branch: string;
9
+ commit: string | null;
10
+ stars: number | null;
11
+ }
12
+
13
+ interface CorpusExpected {
14
+ runtime: string | null;
15
+ packageManager: string | null;
16
+ framework: string | null;
17
+ platform: string | null;
18
+ install: string | null;
19
+ build: string | null;
20
+ start: string | null;
21
+ nodeVersion: string | null;
22
+ pythonVersion: string | null;
23
+ tokenKey: string | null;
24
+ warnings: string[];
25
+ }
26
+
27
+ interface CorpusFixture {
28
+ source: CorpusSource;
29
+ files: string[];
30
+ contents: Record<string, string>;
31
+ expected: CorpusExpected;
32
+ }
33
+
34
+ const CORPUS_DIRECTORY = join(import.meta.dir, "corpus");
35
+
36
+ const fixtures = readdirSync(CORPUS_DIRECTORY)
37
+ .filter((name) => name.endsWith(".json"))
38
+ .sort()
39
+ .map((name) => {
40
+ return {
41
+ name: name.slice(0, -".json".length),
42
+ fixture: JSON.parse(readFileSync(join(CORPUS_DIRECTORY, name), "utf8")) as CorpusFixture,
43
+ };
44
+ });
45
+
46
+ describe("detect", () => {
47
+ it("holds at least the four templates and twenty real bots", () => {
48
+ expect(fixtures.length).toBeGreaterThanOrEqual(24);
49
+ });
50
+
51
+ for (const { name, fixture } of fixtures) {
52
+ it(`reads ${name} as its author expects (${fixture.source.url})`, () => {
53
+ const result = detect({
54
+ files: fixture.files.map((path) => ({
55
+ path,
56
+ })),
57
+ contents: fixture.contents,
58
+ });
59
+
60
+ const actual: CorpusExpected = {
61
+ runtime: result.runtime,
62
+ packageManager: result.packageManager,
63
+ framework: result.framework,
64
+ platform: result.platform,
65
+ install: result.install?.command ?? null,
66
+ build: result.build?.command ?? null,
67
+ start: result.start?.command ?? null,
68
+ nodeVersion: result.nodeVersion,
69
+ pythonVersion: result.pythonVersion,
70
+ tokenKey: result.tokenKey,
71
+ warnings: result.warnings,
72
+ };
73
+
74
+ expect(actual).toEqual(fixture.expected);
75
+ });
76
+ }
77
+ });