{"id":19621097,"url":"https://github.com/baked-libs/bstats-discord-integration","last_synced_at":"2025-04-28T03:32:13.010Z","repository":{"id":43336723,"uuid":"385225388","full_name":"baked-libs/bstats-discord-integration","owner":"baked-libs","description":"A simple program which queries https://bstats.org/ and presents this data in a highly customizable discord webhook","archived":false,"fork":false,"pushed_at":"2025-04-24T23:12:27.000Z","size":155,"stargazers_count":3,"open_issues_count":8,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-25T00:25:57.885Z","etag":null,"topics":["bstats","data","discord","discord-webhook","javascript","minecraft","notifications","paper","plugin","spigot","statistic","stats","typescript","webhook"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/baked-libs.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":"2021-07-12T11:33:59.000Z","updated_at":"2023-03-23T14:19:04.000Z","dependencies_parsed_at":"2022-09-03T04:11:39.430Z","dependency_job_id":"601bab3b-91b6-46f1-ac9c-aa295d7c82e8","html_url":"https://github.com/baked-libs/bstats-discord-integration","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baked-libs%2Fbstats-discord-integration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baked-libs%2Fbstats-discord-integration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baked-libs%2Fbstats-discord-integration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baked-libs%2Fbstats-discord-integration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/baked-libs","download_url":"https://codeload.github.com/baked-libs/bstats-discord-integration/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251246231,"owners_count":21558761,"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":["bstats","data","discord","discord-webhook","javascript","minecraft","notifications","paper","plugin","spigot","statistic","stats","typescript","webhook"],"created_at":"2024-11-11T11:21:24.275Z","updated_at":"2025-04-28T03:32:12.568Z","avatar_url":"https://github.com/baked-libs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :speech_balloon: Discord Integration for bStats.org\nThis is a simple program written in TypeScript which allows you to query https://bstats.org/ and format it in a nice and human-friendly manner to post to your discord server via a webhook.\n\n## :question: Usage\n**TODO...**\n\n## :framed_picture: Screenshots / Examples\nWe tested this integration on two projects, here are these two examples along with their configuration script.\n\n| Slimefun ([4574](https://bstats.org/plugin/bukkit/Slimefun/4574)) | Craftory ([7804](https://bstats.org/plugin/bukkit/Craftory/7804)) |\n| :---------------------------------: | :------------------------------: |\n| ![bStats data for Slimefun](https://raw.githubusercontent.com/baked-libs/bstats-discord-integration/main/.github/screenshots/slimefun.png) | ![bStats data for Craftory](https://raw.githubusercontent.com/baked-libs/bstats-discord-integration/main/.github/screenshots/craftory.png) |\n\n\u003cdetails\u003e\u003csummary\u003eSee the config script for 'Slimefun'...\u003c/summary\u003e\n\n```typescript\nimport { Project, Platform, WebhookCredentials, ChartEmbed } from './types'\n\nexport const project = {\n    name: 'Slimefun',\n    id: 4574,\n    platform: Platform.BUKKIT,\n    color: '0x1A62D6',\n    charts: [\n        'servers',\n        'players',\n        'serverSoftware',\n        'minecraftVersion',\n        'javaVersion',\n        'location',\n        'compatibility_mode',\n        'auto_updates',\n        'cs-corelib_installed'\n    ]\n} as Project\n\nexport const webhook = {\n    id: '******************',\n    token: '*******************************************************************'\n} as WebhookCredentials\n\nexport function getContent(charts: any): ChartEmbed[] {\n    let prefix = ':small_blue_diamond:'\n\n    return [\n        {\n            name: ':bar_chart:  Statistics',\n            inline: false,\n            lines: [\n                `${prefix} ${charts['servers'].current} servers (peak: ${charts['servers'].peak})`,\n                `${prefix} ${charts['players'].current} players (peak: ${charts['players'].peak})`\n            ]\n        },\n        {\n            name: ':bulb:  Interesting facts',\n            inline: false,\n            lines: [\n                `${prefix} ${charts['auto_updates'].for('enabled').percentage} have enabled automatic updates.`,\n                `${prefix} ${charts['compatibility_mode'].for('disabled').percentage} have disabled compatibility-mode.`,\n                `${prefix} ${charts['cs-corelib_installed'].for('No').percentage} have removed CS-CoreLib.`\n            ]\n        },\n        {\n            name: ':computer:  Server software',\n            inline: true,\n            lines: [\n                `${prefix} Paper: ${charts['serverSoftware'].for('Paper').percentage}`,\n                `${prefix} Spigot: ${charts['serverSoftware'].for('Spigot').percentage}`,\n                `${prefix} Tuinity: ${charts['serverSoftware'].for('Tuinity').percentage}`,\n                `${prefix} Other: ${charts['serverSoftware'].forAllExcept(['Paper', 'Spigot', 'Tuinity']).percentage}`\n            ]\n        },\n        {\n            name: ':video_game:  Minecraft version',\n            inline: true,\n            lines: [\n                `${prefix} 1.17: ${charts['minecraftVersion'].forAny(/1\\.17(?:\\.\\d+)?/).percentage}`,\n                `${prefix} 1.16: ${charts['minecraftVersion'].forAny(/1\\.16(?:\\.\\d+)?/).percentage}`,\n                `${prefix} 1.15: ${charts['minecraftVersion'].forAny(/1\\.15(?:\\.\\d+)?/).percentage}`,\n                `${prefix} 1.14: ${charts['minecraftVersion'].forAny(/1\\.14(?:\\.\\d+)?/).percentage}`\n            ]\n        },\n        {\n            name: ':floppy_disk:  Java version',\n            inline: true,\n            lines: [\n                `${prefix} Java 16: ${charts['javaVersion'].for('Java 16').percentage}`,\n                `${prefix} Java 11: ${charts['javaVersion'].for('Java 11').percentage}`,\n                `${prefix} Java 8: ${charts['javaVersion'].for('Java 8').percentage}`,\n                `${prefix} Other: ${charts['javaVersion'].forAllExcept(['Java 16', 'Java 11', 'Java 8']).percentage}`\n            ]\n        }\n    ];\n}\n```\n\u003c/details\u003e\n\u003cdetails\u003e\u003csummary\u003eSee the config script for 'Craftory'...\u003c/summary\u003e\n\n```typescript\nimport { Project, Platform, WebhookCredentials, ChartEmbed } from './types'\n\nexport const project = {\n    name: 'Craftory',\n    id: 7804,\n    platform: Platform.BUKKIT,\n    color: '0x1A62D6',\n    icon: 'https://avatars.githubusercontent.com/u/71320561',\n    charts: [\n        'servers',\n        'players',\n        'serverSoftware',\n        'minecraftVersion',\n        'javaVersion',\n        'location',\n        'os'\n    ]\n} as Project\n\nexport const webhook = {\n    id: '******************',\n    token: '*******************************************************************'\n} as WebhookCredentials\n\nexport function getContent(charts: any): ChartEmbed[] {\n    return [\n        {\n            name: ':bar_chart:  Statistics',\n            inline: false,\n            lines: [\n                `:small_blue_diamond: ${charts['servers'].current} servers (peak: ${charts['servers'].peak})`,\n                `:small_blue_diamond: ${charts['players'].current} players (peak: ${charts['players'].peak})`\n            ]\n        },\n        {\n            name: ':computer:  Server software',\n            inline: true,\n            lines: [\n                `:small_blue_diamond: Paper: ${charts['serverSoftware'].for('Paper').percentage}`,\n                `:small_blue_diamond: Spigot: ${charts['serverSoftware'].for('Spigot').percentage}`,\n                `:small_blue_diamond: Other: ${charts['serverSoftware'].forAllExcept(['Paper', 'Spigot']).percentage}`\n            ]\n        },\n        {\n            name: ':video_game:  Minecraft version',\n            inline: true,\n            lines: [\n                `:small_blue_diamond: 1.17: ${charts['minecraftVersion'].forAny(/1\\.17(?:\\.\\d+)?/).percentage}`,\n                `:small_blue_diamond: 1.16: ${charts['minecraftVersion'].forAny(/1\\.16(?:\\.\\d+)?/).percentage}`,\n                `:small_blue_diamond: 1.15: ${charts['minecraftVersion'].forAny(/1\\.15(?:\\.\\d+)?/).percentage}`\n            ]\n        },\n        {\n            name: ':floppy_disk:  Java version',\n            inline: true,\n            lines: [\n                `:small_blue_diamond: Java 16: ${charts['javaVersion'].for('Java 16').percentage}`,\n                `:small_blue_diamond: Java 11: ${charts['javaVersion'].for('Java 11').percentage}`,\n                `:small_blue_diamond: Java 8: ${charts['javaVersion'].for('Java 8').percentage}`\n            ]\n        },\n        {\n            name: ':bulb:  Interesting facts',\n            inline: false,\n            lines: [\n                `:small_blue_diamond: Most ${project.name} servers are based in ${charts['location'].top().label}.`,\n                `:small_blue_diamond: Most ${project.name} servers are running on ${charts['os'].top().label}.`\n            ]\n        }\n    ]\n}\n```\n\u003c/details\u003e\n\n\n## :balance_scale: Disclaimer / Licensing\nThis projet is licensed under the [MIT license](https://github.com/baked-libs/bstats-discord-integration/blob/main/LICENSE), the code is open-source and contributions are very much welcome!\nThis is just a little fun project, we are not affiliated with https://bstats.org/ in any way or form.\n\nThe project is built upon [bStats' REST-API](https://bstats.org/help/rest-api).\nThis API may be subject to change, potentially breaking this software.\nBe aware of this and simply [file an issue](https://github.com/baked-libs/bstats-discord-integration/issues) when that happens.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaked-libs%2Fbstats-discord-integration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaked-libs%2Fbstats-discord-integration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaked-libs%2Fbstats-discord-integration/lists"}