{"id":22482392,"url":"https://github.com/mara-li/knitting-bot","last_synced_at":"2025-08-02T16:31:31.131Z","repository":{"id":159278945,"uuid":"634305934","full_name":"Mara-Li/Knitting-bot","owner":"Mara-Li","description":"A little discord bot write in TypeScript that automatically add / remove member in thread, without pinging them!","archived":false,"fork":false,"pushed_at":"2024-11-25T23:19:54.000Z","size":942,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-12-06T08:07:32.721Z","etag":null,"topics":["bot","discord","management","thread","threadmanagement","typescript"],"latest_commit_sha":null,"homepage":"","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/Mara-Li.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2023-04-29T17:42:43.000Z","updated_at":"2024-11-25T23:19:59.000Z","dependencies_parsed_at":"2024-11-26T00:22:56.350Z","dependency_job_id":"15a43d5e-f752-4850-83db-48e71ab5984a","html_url":"https://github.com/Mara-Li/Knitting-bot","commit_stats":null,"previous_names":["mara-li/knitting-bot"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mara-Li%2FKnitting-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mara-Li%2FKnitting-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mara-Li%2FKnitting-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mara-Li%2FKnitting-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mara-Li","download_url":"https://codeload.github.com/Mara-Li/Knitting-bot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228492671,"owners_count":17928867,"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","management","thread","threadmanagement","typescript"],"created_at":"2024-12-06T16:24:40.477Z","updated_at":"2025-08-02T16:31:31.112Z","avatar_url":"https://github.com/Mara-Li.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Knitting\n\n→ [Traduction française](README_FR.md)\n\n[Invitation links](https://discord.com/api/oauth2/authorize?client_id=1101559076086886500\u0026permissions=292057785360\u0026scope=bot)\n\n\u003e [!WARNING]\n\u003e When invited the bot is in `manual mode`, to prevents errors when the bot is added to a server. \n\u003e You need to activate the automatic events with the `/config auto` command.\n\nIf you want to try out the bot, you can join [this discord server](https://discord.gg/TWjfz2yTSA)!\n\nA bot that helps you to add user to a thread, to keep the thread always visible for everyone, and without pinging them!\n\n\u003e [!NOTE] \n\u003e The user added to the thread needs to have the permission to see it.\n\nThe bot will automatically add a user to a thread when:\n- A user joins the server and has the permission to see the thread\n- A user is updated and gets a new role\n- When a channel or category that have their permission edited\n- When a thread is created\n\nThe bot won't do anything when joining the server. If you want to update all threads, you can use the slash command `/update-all-threads` (see below).\n\n## Slash Commands\n\n### Configuration\n\nThe slash command `/config` allows you to configure the bot. It will open a window with buttons to change the configuration.\n\n#### `/config language`\nDisplays the current language and allows you to change it.\n\n#### `/config mode`\n\nDisplays the current modes and allows you to change them. You can:\n- Only follow a specific channel (_Note: Here, \"channel\" includes categories, forums, threads, and channels).\n- Only follow a specific role.\n- Use the \"[@role] for [@channel]\" mode, which cannot be used with other modes.\n\n#### `/config auto`\n\nDisplays the current automatic events and allows you to change them. You can enable or disable the following automatic events:\n- Thread creation.\n- Channel, category, forum, or thread permission updates.\n- User role updates.\n- User joining the server.\n\nYou can also enable the \"manual\" mode, which disables all automatic events.\n\n#### `/config help`\n\nDisplays general information about bot configuration, as well as a link to the README.\n\n\u003e [!NOTE]  \n\u003e The button will be red if activate it will disable the event, and green if it will enable it.\n\n### Follow\n\nAllow to only \"ping\" specific channels or roles.\n\nYou need to activate the `follow-only` mode to use these commands. You can do that with the `/config` command.\n\n- `/follow channel (channel)` : Add a channel to the list of followed channels[^1]. If the channel is not specified, it will use the current channel.\n- `/follow role [role]` : Add a role to the list of followed roles\n- `/follow specific [role] [channel]` : Add a role to the list of followed roles in a specific channel[^1].\n  - You can repeat the command with the same role to add multiple channels.\n  - To remove a channel, you need to redo the command with the same channel and role.\n  - To remove a role completely, you need to do the command without the channel.\n- `/follow list` : List all followed channels and roles\n\n\u003e [!NOTE]  \n\u003e To unfollow a channel/role, you need to redo the command with the same channel/role.\n\n### Ignore\n\nThe exact opposite of the follow command. It won't ping the channels or roles ignored.\n\n- `/ignore channel (channel)` : Add a channel to the list of ignored channels[^1]. If the channel is not specified, it will use the current channel.\n- `/ignore role [role]` : Add a role to the list of ignored roles\n- `/ignore specific [role] [channel]` : Add a role to the list of ignored roles in a specific channel[^1].\n  - You can repeat the command with the same role to add multiple channels.\n  - To remove a channel, you need to redo the command with the same channel and role.\n  - To remove a role completely, you need to do the command without the channel.\n- `/ignore list` : List all ignored channels and roles\n\n\u003e [!NOTE]  \n\u003e To un-ignore a channel, you need to redo the command with the same channel. Same for the role.\n\n\u003e [!WARNING]  \n\u003e You can't follow and ignore \"role\" or \"channel\" at the same time.\n\u003e For example:\n\u003e\n\u003e - If the `only-channel` mode is activated, you can't ignore a channel.\n\u003e - If the `only-role` mode is activated, you can't ignore a role.\n\u003e   Factually, the `follow` commands will ignore all un-specified channels/roles.\n\n### Update\n\nIf you want to manually update a thread, you can use the slash commands:\n\n- `/update thread (thread)` : Update a specific thread. If the thread is not specified, it will update the current thread.\n- `/update all` : Update all threads in the server\n- `/update help` : Get help about the manual slash commands\n\nThese commands don't appear for user that haven't the `manage thread` permission.\n\n\u003e [!WARNING]  \n\u003e It will re-add all users that leave the thread, even if they left it on purpose.\n\n\u003e [!NOTE]  \n\u003e There is no way that I can code something that don't add any notification on the thread.\n\u003e You **always** will have the thread that becomes white when the bot activates.\n\nMore over, you can configure the bot and disable event that you don't want to use. You can do that with the `/config` command. You can see the configuration with `/config show`\n\n### Info\n\nA simple embed with some information about the bot and the main developer.\n\n## How it's work\n\nFor some optimization purpose, the bot will first @role when a thread must be updated. After it will check if some users (that don't have role/allowed role) can see the thread and add them.\nMoreover, if there is no role in the server, the bot process on the members list instead.\n\nNote that role will be mentioned if some users that have the role aren't in the thread.\n\nAfter making the list of user/role to ping, there is two possibility:\n\n- If a older message of the bot exists, it will edit it with the new list of user/role to ping.\n- If not, it will send a empty message (with `_ _`) and edit it with the new list of user/role to ping.\n\nAfter sending/editing the message, the bot will edit the message again to `_ _`.\n\n\u003e [!WARNING]  \n\u003e The message send won't be deleted, because I discover that if a ping with editing an old message doesn't make a notification.\n\u003e So the bot will keep this message to edit it when the thread need to be updated.\n\u003e With that, user already in the thread won't get a white notification on the thread.\n\n### Permission asked\n\nThe bot needs some intents to work:\n\n- Presence\n- Server members\n\n(For some reason, the bot needs the presence intents to get the user id when they join the server)\n\n---\n\n# 🤖 Development\n\nThe bot is made with [discord.js](https://discord.js.org/#/). You need to have [node.js (LTS)](https://nodejs.org/en/) installed on your computer.\nAfter cloning the repo, you need to install the dependencies with:\n\n```bash\nnpm run init\n```\n\nThe script will ask your for your `.env` variable, and the file will be created automatically.\nIt can look like this:\n\n```dotenv\nBOT_TOKEN=your_token\nCLIENT_ID=your_client_id\nNODE_ENV=development# or production\nMESSAGE= #Anything you want\nGITHUB_EMOJI=\"1125070935855222845\" #Emoji ID\nKOFI=\"1125071623658164274\" #Emoji ID\nDISCORD=\"1125072006937849876\" #Emoji ID\n```\n\n\u003e [!NOTE]  \n\u003e If you want try your bot, you need to create an application in the [discord developer portal](https://discord.com/developers/applications).\n\u003e [Here a tutorial](https://github.com/reactiflux/discord-irc/wiki/Creating-a-discord-bot-\u0026-getting-a-token)\n\u003e Don't forget to invite your bot in a testing discord server!\n\n- `BOT_TOKEN` is the token of the bot that you can get in `Bot` \u003e `Reset token` in the discord developer portal.\n- `CLIENT_ID` is the client id of the bot, you can get it from `General Information` \u003e `Client ID` in the discord developer portal.\n- `NODE_ENV` is the environment of the bot. It can be `development` or `production`. If you are in development, the bot will log a lot of event. If you are in production, the bot will log only errors.\n- `MESSAGE` : The message you want to send when waiting for the list of users/roles. You can use a simple message, an emoji, stickers or external emoji. Beware of them. The bot must be on the server where the emoji is (but it can use it everywhere).\n\nThe bot uses Enmap to store data. You can find the documentation [here](https://enmap.evie.dev/). You need a special installation for it, so follow the instructions [here](https://enmap.evie.dev/install).\n\n## 🎼 Translation\n\nThe bot is translated in:\n\n- [x] French\n- [x] English\n\nI use i18next to translate the bot. You can find the documentation [here](https://www.i18next.com/).\n\nIf you want to add a translation, you need to:\n\n- Duplicate `src/i18next/locales/en.json` and rename it with the language code (ex: `fr.json`)\n- Translate the file\n- Update the `src/i18next/index.ts` and add the language in the `ressources` object, without forgetting to import it (ex: `import * as fr from \"./locales/fr.json\";`)\n- You need to update **all** commands (`src/commands`) file, and update:\n  - Adding `const lang = i18next.getFixedT(\"lang\");` at the top of the file\n  - Adding `setNameLocalizations({lang: lang(\"same key of other langue\")})`\n  - Adding the language directly in `setDescriptionLocalizations`.\n    You can get more information about [commands localization on the official discordJS documentation](https://discordjs.guide/slash-commands/advanced-creation.html#localizations)\n    The slash commands language is directly based on your discord client language.\n\n---\n\n# Thread Watcher\n\nA cool bot to use with this bot is [Thread Watcher](https://threadwatcher.xyz/)!\n\n[^1]: Channel includes here thread, channel, forum and category.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmara-li%2Fknitting-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmara-li%2Fknitting-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmara-li%2Fknitting-bot/lists"}