{"id":13467291,"url":"https://github.com/countr/countr","last_synced_at":"2025-03-26T01:30:41.904Z","repository":{"id":37063588,"uuid":"171858090","full_name":"countr/countr","owner":"countr","description":"The source code of Countr bot","archived":false,"fork":false,"pushed_at":"2024-10-29T19:34:15.000Z","size":3066,"stargazers_count":129,"open_issues_count":16,"forks_count":48,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-10-29T20:36:34.415Z","etag":null,"topics":["bot","discord","discord-bot","hacktoberfest"],"latest_commit_sha":null,"homepage":"https://countr.xyz","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/countr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["promise"],"patreon":"promises","custom":["paypal.me/nottechsupport"]}},"created_at":"2019-02-21T11:18:27.000Z","updated_at":"2024-10-29T19:34:19.000Z","dependencies_parsed_at":"2023-11-29T06:26:38.574Z","dependency_job_id":"07a3ab80-60bb-4bd0-aeed-b0fd64e612e5","html_url":"https://github.com/countr/countr","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/countr%2Fcountr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/countr%2Fcountr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/countr%2Fcountr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/countr%2Fcountr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/countr","download_url":"https://codeload.github.com/countr/countr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245571712,"owners_count":20637382,"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":["bot","discord","discord-bot","hacktoberfest"],"created_at":"2024-07-31T15:00:54.808Z","updated_at":"2025-03-26T01:30:41.443Z","avatar_url":"https://github.com/countr.png","language":"TypeScript","funding_links":["https://github.com/sponsors/promise","https://patreon.com/promises","paypal.me/nottechsupport"],"categories":["Bots","TypeScript"],"sub_categories":["Open Source Public Bots"],"readme":"[![Docker test](https://img.shields.io/github/actions/workflow/status/countr/countr/docker-compose-test.yml)](https://github.com/countr/countr/actions/workflows/docker-compose-test.yml)\r\n[![Linting](https://img.shields.io/github/actions/workflow/status/countr/countr/linting.yml?label=quality)](https://github.com/countr/countr/actions/workflows/linting.yml)\r\n[![Testing](https://img.shields.io/github/actions/workflow/status/countr/countr/testing.yml?label=test)](https://github.com/countr/countr/actions/workflows/testing.yml)\r\n[![DeepScan grade](https://deepscan.io/api/teams/16173/projects/19382/branches/641642/badge/grade.svg)](https://deepscan.io/dashboard#view=project\u0026tid=16173\u0026pid=19382\u0026bid=641642)\r\n[![discord.js version](https://img.shields.io/github/package-json/dependency-version/countr/countr/discord.js)](https://www.npmjs.com/package/discord.js)\r\n[![GitHub Issues](https://img.shields.io/github/issues-raw/countr/countr.svg)](https://github.com/countr/countr/issues)\r\n[![GitHub Pull Requests](https://img.shields.io/github/issues-pr-raw/countr/countr.svg)](https://github.com/countr/countr/pulls)\r\n\r\n# Countr\r\n\r\nCountr is an advanced counting bot which can manage a counting channel in your guild. With a simple setup, your channel is ready.\r\n\r\nRead more about Countr on our [website](https://countr.xyz)\r\n\r\n## Setup for self hosting\r\n\r\nCopy the `example.env` to `.env` and fill in the values. Below is a table with a description for each environment variable. We've excluded some variables that are not needed for private use.\r\n\r\n| Variable     | Description                                                | Required    |\r\n|:-------------|:-----------------------------------------------------------|:------------|\r\n| `BOT_TOKEN`  | The token of the bot                                       | Yes         |\r\n| `API_PORT`   | The port of the API (just put it to something like `9123`) | Yes         |\r\n| `BOT_ID`     | The ID of the bot                                          | Recommended |\r\n| `OWNER`      | The ID of the owner                                        | Recommended |\r\n| `GUILD`      | The ID of your main guild                                  | Recommended |\r\n| `ADMINS`     | The IDs of the admins separated with a comma               | No          |\r\n| `IS_PREMIUM` | Whether the bot is premium or not (`true`/`false`)         | No          |\r\n\r\nOnce you're done filling the values, you can do `npm run docker:up`. You can stop it using `npm run docker:down` and view logs using `npm run docker:logs` or by going to the `logs` directory.\r\n\r\n## Contributing and development\r\n\r\n### Local development\r\n\r\nYou can set it up however you'd like, however we like to use [`nodemon`](https://nodemon.io/) to automatically restart our bot when changes are made. Doing local development in our way is a little complicated as you need three terminals open, as well as a mongo instance, but it should be fine.\r\n\r\nYou can set up a temporary mongo instance using Docker: `docker run --name countr-dev-db -d mongo:4 --ports 27000:27000` - keep in mind this won't store your data when you stop the container. You can start and stop this instance with `docker start/stop countr-dev-db`. Your`DATABASE_URI` will be `mongodb://localhost:27000/countr`.\r\n\r\nYou still need your envoironment variables set up and stuff though, however there are different environment variables for local development. There's more advanced environment variables than the ones listed below, you can see them all in the [`src/config.ts`](src/config.ts) file.\r\n\r\n| Variable       | Description                                                | Required    |\r\n|:---------------|:-----------------------------------------------------------|:------------|\r\n| `BOT_TOKEN`    | The token of the bot                                       | Yes         |\r\n| `DATABASE_URI` | The URI of the mongo instance                              | Yes         |\r\n| `BOT_ID`       | The ID of the bot                                          | Recommended |\r\n| `OWNER`        | The ID of the owner                                        | Recommended |\r\n| `GUILD`        | The ID of your main guild                                  | Recommended |\r\n| `ADMINS`       | The IDs of the admins separated with a comma               | No          |\r\n| `API_PORT`     | The port of the API                                        | No          |\r\n| `IS_PREMIUM`   | Whether the bot is premium or not (`true`/`false`)         | No          |\r\n\r\n- Terminal 1: `npm run watch`\r\n  - This will compile our TypeScript to JavaScript and will put it in the `build` folder.\r\n- Terminal 2: `npm run start:manager`\r\n  - This will start the manager. We don't use nodemon for this as we rarely edit the manager's code anyways. It will also bug out if we use nodemon on both instances.\r\n- Terminal 3: `nodemon -d 0.1 --watch build`\r\n  - This will start the bot, and will watch for any changes in the `build` folder.\r\n\r\nOnce your code is finished, make sure it's all linted. You can run `npm run lint:fix` to see any non-autofixable linting errors.\r\n\r\n### GitHub Codespaces (Devcontainer)\r\n\r\nFor those of you that have GitHub Pro, or in other ways have access to [GitHub Codespaces](https://github.com/codespaces), you can use a Codespace to work on Countr. We use this ourselves, and it's quite easy to set up. Just [click here](https://github.com/codespaces/new?hide_repo_select=true\u0026ref=main\u0026repo=171858090) to create a new Codespace of this repository.\r\n\r\nIt will take a few minutes to set up, but once it's done, you can start working on Countr, but all your necessary tools will be installed automatically, including a Mongo database. A pre-configured `.env` file will be created for you, all you need to do is fill in the missing values.\r\n\r\nYou will still need to set up the three terminals mentioned in the local development section.\r\n\r\n## Suggestions, bugs, feature requests\r\n\r\nWant to contribute? Great, we love that! Please take your time on [opening a new issue](https://github.com/countr/countr/issues/new).\r\n\r\n## Contributors\r\n\r\nYou can see all contributors and their GitHub-profiles [here](https://github.com/countr/countr/graphs/contributors).\r\n\r\n## License\r\n\r\nWe use the GNU GPLv3-license.\r\n\r\n\u003e You may copy, distribute and modify the software as long as you track changes/dates in source files. Any modifications to or software including (via compiler) GPL-licensed code must also be made available under the GPL along with build \u0026 install instructions.\r\n\r\nFetched from [TLDRLegal](https://tldrlegal.com/license/gnu-general-public-license-v3-(gpl-3)), please also read the [license](https://github.com/countr/countr/blob/master/LICENSE) if you plan on using the source code. This is only a short summary. Please also take note of that we are not forced to help you, and we won't help you host it yourself as we do not recommend you doing so.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcountr%2Fcountr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcountr%2Fcountr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcountr%2Fcountr/lists"}