{"id":27884988,"url":"https://github.com/toitlang/action-discord-transcript","last_synced_at":"2025-05-05T06:44:27.505Z","repository":{"id":280048246,"uuid":"940830433","full_name":"toitlang/action-discord-transcript","owner":"toitlang","description":"Create transcripts for Discord chats","archived":false,"fork":false,"pushed_at":"2025-04-22T08:27:44.000Z","size":14186,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-22T09:36:48.965Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/toitlang.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":"2025-02-28T21:51:22.000Z","updated_at":"2025-04-22T08:27:47.000Z","dependencies_parsed_at":"2025-03-01T00:33:02.876Z","dependency_job_id":"fced1e2f-7d5e-4568-8157-541614cf42ba","html_url":"https://github.com/toitlang/action-discord-transcript","commit_stats":null,"previous_names":["toitlang/action-discord-transcript"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toitlang%2Faction-discord-transcript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toitlang%2Faction-discord-transcript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toitlang%2Faction-discord-transcript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toitlang%2Faction-discord-transcript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/toitlang","download_url":"https://codeload.github.com/toitlang/action-discord-transcript/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252455412,"owners_count":21750511,"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":[],"created_at":"2025-05-05T06:44:26.805Z","updated_at":"2025-05-05T06:44:27.499Z","avatar_url":"https://github.com/toitlang.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Discord Transcript Action\n\nThis bot connects to Discord and generates HTML transcripts for the #help\nchannel.\n\n## Features\n\n- Generates HTML transcripts using the `discord-html-transcripts` package\n- Saves transcripts to a specified output directory\n\n### Inputs\n\n- `discord-token`: The authentication token of the Discord bot. See below for\n  instructions on how to create a bot and get the token.\n- `guild-id`: The guild ID. You can find this by right-clicking on the server\n  icon and selecting \"Copy ID\".\n- `transcript-directory`: The directory where the transcripts are/will be saved.\n\nIf an existing directory is specified, then the action will only fetch threads\nthat have been modified or don't exist yet.\n\n## Example\n\n```yaml\nenv:\n  # Don't forget to put the guild ID in quotes.\n  GUILD_ID: '123456789012345678'\n---\n- name: 'Run the transcript action'\n  uses: toitlang/action-discord-transcript@v1.3.1\n  with:\n    discord-token: ${{ secrets.DISCORD_TOKEN }}\n    guild-id: { { env.GUILD_ID } }\n    transcript-directory: transcripts\n```\n\nTypically, this step is followed by a step that commits the output, and one that\nuploads the transcript to the gh-pages branch of the repository.\n\n```yaml\n- name: 'Commit the transcripts'\n  run: |\n    git config --global user.email \"github-actions[bot]@users.noreply.github.com\"\n    git config --global user.name \"github-actions[bot]\"\n    git add transcripts\n    git commit -m \"Update transcripts\"\n    git push\n\n- name: 'Upload to gh-pages'\n  uses: peaceiris/actions-gh-pages@v4\n  with:\n    github_token: ${{ secrets.GITHUB_TOKEN }}\n    publish_dir: transcripts\n    cname: 'example.com'\n```\n\n## Output\n\nThe transcript directory contains an HMTL file for each thread in the #help\nforum.\n\nIn addition, the output directory contains a `index.html` file that links to all\nthe transcripts.\n\nFinally, it also produces an `index.json` file that contains the metadata for\neach transcript. This can be used to generate a more complex index page.\n\nHere is a screenshot of the generated index page for the\n[Toit Discord page](https://chat.toit.io), served at the\n[Toit help](https://help.toit.io) page.\n\n![Index page](./screens/toit-help-screen.png)\n\n## Incremental updates\n\nIf the transcript directory already exists and contains the index.json file,\nthen the action will only fetch threads that have been modified or don't exist\nyet.\n\n## Run locally\n\nYou can also just run the transcript generation locally.\n\nMake sure to run with Node 20. Use, for example, `nvm` to install it. The\nrepository contains a `.nvmrc` file that specifies the node version that works.\nIt also contains a `.node-version` file that is used by GitHub to fetch the\ncorrect version.\n\nIf you have nvm installed, but not automatically activated in your .bashrc, you\nwill need to do\n\n```bash\nsource /usr/share/nvm/init-nvm.sh\n```\n\nThen run `nvm install` to install the correct version of node.\n\nInstall the dependencies.\n\n```bash\nnpm install\n```\n\nSave the Discord credentials and your input parameters to a `.env` file. Use the\n.env.example as a starting point.\n\n```bash\nINPUT_discord-token=YOUR_DISCORD_TOKEN\nINPUT_guild-id=YOUR_GUILD_ID\nINPUT_transcript-directory=transcripts\n```\n\nRun the script.\n\n```bash\nnpm run local-action\n```\n\n## Discord bot\n\nThe following instructions mirror the ones provided on Discord's official\n[quick-start guide](https://discord.com/developers/docs/quick-start/getting-started)\n\nTo create a Discord bot, follow these steps:\n\n- Create a\n  [new application](https://discord.com/developers/applications?new_application=true)\n- In the 'Installation' tab:\n  - Unselect 'User Install'.\n  - Switch the Install link to 'None'.\n  - Save the changes.\n- In the 'Bot' tab:\n  - click on 'Reset Token'. This will generate a new token. You will need this\n    token as input to the action. Typically it is saved as a GitHub Action\n    secret.\n  - Disable 'Public bot'.\n  - Enable 'Message content intent'.\n  - Save the changes\n- In the 'OAuth2' tab:\n  - In the scopes select 'bot'. This opens up the bot permissions.\n  - In the bot permissions, select 'View Channels' and 'Read Message History'.\n  - Copy the URL and paste it in your browser. This will open a page that allows\n    you to add the bot to a server. Select the server where you want to run the\n    action.\n\nYou can uninstall a bot by kicking it from the server.\n\n## References\n\nThis repository is based on the\n[TypeScript Action template](https://github.com/actions/typescript-action).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoitlang%2Faction-discord-transcript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoitlang%2Faction-discord-transcript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoitlang%2Faction-discord-transcript/lists"}