{"id":28166457,"url":"https://github.com/finki-hub/finki-discord-bot","last_synced_at":"2025-05-15T13:13:29.009Z","repository":{"id":60367402,"uuid":"517461472","full_name":"finki-hub/finki-discord-bot","owner":"finki-hub","description":"Discord bot for managing the FINKI Students Discord server, as well as providing information about various data collected from the university","archived":false,"fork":false,"pushed_at":"2025-05-06T22:33:45.000Z","size":5159,"stargazers_count":21,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-06T23:27:59.470Z","etag":null,"topics":["bot","discord","fcse","finki","ukim"],"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/finki-hub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-07-24T23:39:29.000Z","updated_at":"2025-05-06T22:33:49.000Z","dependencies_parsed_at":"2024-03-10T22:39:33.783Z","dependency_job_id":"2b4a67fe-c42f-4863-bbad-d79c2a470be4","html_url":"https://github.com/finki-hub/finki-discord-bot","commit_stats":null,"previous_names":["finki-hub/finki-discord-bot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finki-hub%2Ffinki-discord-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finki-hub%2Ffinki-discord-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finki-hub%2Ffinki-discord-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finki-hub%2Ffinki-discord-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/finki-hub","download_url":"https://codeload.github.com/finki-hub/finki-discord-bot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254346600,"owners_count":22055809,"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","fcse","finki","ukim"],"created_at":"2025-05-15T13:12:21.610Z","updated_at":"2025-05-15T13:13:29.001Z","avatar_url":"https://github.com/finki-hub.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FINKI Discord Bot\n\nDiscord bot for the [`FCSE Students`](https://discord.gg/finki-studenti-810997107376914444) Discord server, powered by [discord.js](https://github.com/discordjs/discord.js) 14. Requires Node.js and PostgreSQL. It is recommended to use the latest LTS versions of both.\n\n## Quick Setup (Production)\n\nIf you would like to just run the bot:\n\n1. Download [`compose.prod.yaml`](./compose.prod.yaml)\n2. Run `docker compose -f compose.prod.yaml up -d`\n\nIf you wish to avoid Docker, you will have to setup your own PostgreSQL instance and set the `DATABASE_URL` env. variable to point to it.\n\nThis Docker image is available as [ghcr.io/finki-hub/finki-discord-bot](https://github.com/finki-hub/finki-discord-bot/pkgs/container/finki-discord-bot).\n\n## Quick Setup (Development)\n\n1. Clone the repository: `git clone https://github.com/finki-hub/finki-discord-bot.git`\n2. Install dependencies (and pre-commit hooks): `npm i`\n3. Generate the database schema typings: `npm run generate`\n4. Prepare env. variables by copying `env.sample` to `.env` - minimum setup requires `BOT_TOKEN` and `APPLICATION_ID`\n5. Build the project in Docker: `docker compose build`\n6. Run it: `docker compose up -d`\n\nThere is also a dev container available. To use it, just clone the repository, define the env. variables and open the container. Your development environment will be prepared automatically.\n\n## Setup Without Docker\n\n1. Clone the repository: `git clone https://github.com/finki-hub/finki-discord-bot.git`\n2. Install dependencies (and pre-commit hooks): `npm i`\n3. Generate the database schema typings: `npm run generate`\n4. Make sure to have a PostgreSQL instance running\n5. Prepare env. variables by copying `env.sample` to `.env` - minimum setup requires `BOT_TOKEN`, `APPLICATION_ID` and `DATABASE_URL`\n6. Deploy latest database schema: `npm run apply`\n7. Build the project: `npm run build`\n8. Run it: `npm run start:env` or `npm run dev` (for hot reloading)\n\n## Configuration\n\n### Environment\n\nThe env. variables are stored in `.env.sample`. Only the `BOT_TOKEN` and `APPLICATION_ID` variables are required (for logging in to Discord) and `DATABASE_URL` (for the database connection).\n\n### Files\n\nThe data for the informational commands is stored in these files. It is not required to configure them. Here is a list of all files:\n\n1. `classrooms.json` - an array of all the classrooms\n2. `courses.json` - an array of the names of all courses\n3. `information.json` - an array of all the course information\n4. `participants.json` - an array of all courses and their number of participants\n5. `prerequisites.json` - an array of course prerequisites\n6. `professors.json` - an array of all courses and their professors and assistants\n7. `roles.json` - roles for the scripts and for the embeds\n8. `sessions.json` - an object of all exam sessions\n9. `staff.json` - an array of the staff\n\n### Sessions (Timetables)\n\nAll the session schedule files should be placed in the `sessions` folder. The names of the files should match the respective names in `sessions.json`.\n\n## Integration With `finki-chat-bot`\n\nThis project features integration with [`finki-chat-bot`](https://github.com/finki-hub/finki-chat-bot) for enabling the FAQ and links functionality. The Discord bot fetches and mutates data from the chat bot using REST endpoints. If they are deployed in Docker, they should be on the same network to be able to communicate.\n\nPlease set the `CHATBOT_URL` env. variable to the URL of the chat bot.\n\n## Frequently Asked Questions\n\n1. How to create a database migration?\n   - Make a change to `prisma.schema` and run `npm run migrate`\n2. How to run all database migrations?\n   - Run `npm run apply`\n3. Can SQLite be used instead of PostgreSQL?\n   - Unfortunately, no. Prisma does not allow the database provider to be changed after creating the first migration.\n4. The hot reloading is too slow\n   - This is a Discord limitation because the bot has to relogin each time\n5. How do I create a Discord bot?\n   - Refer to \u003chttps://discord.com/developers/applications\u003e\n\n## Frequently Encountered Errors\n\n1. \"The table `public.Config` does not exist in the current database.\"\n   - You have not deployed the database migrations. Run `npm run apply`\n2. \"Error: Used disallowed intents\"\n   - You must enable all intents in the Discord Developer Portal\n3. \"Error \\[TokenInvalid]: An invalid token was provided.\"\n   - Your bot token is invalid.\n\n## License\n\nThis project is licensed under the terms of the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffinki-hub%2Ffinki-discord-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffinki-hub%2Ffinki-discord-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffinki-hub%2Ffinki-discord-bot/lists"}