{"id":16495614,"url":"https://github.com/joelpurra/botten-nappet","last_synced_at":"2025-10-27T23:31:24.424Z","repository":{"id":50707975,"uuid":"118003864","full_name":"joelpurra/botten-nappet","owner":"joelpurra","description":"A Twitch bot and streaming tool.","archived":false,"fork":false,"pushed_at":"2018-07-29T15:25:21.000Z","size":955,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"develop","last_synced_at":"2025-02-01T09:04:07.177Z","etag":null,"topics":["bot","nodejs","server","streaming","twitch","twitch-api","twitch-bot","twitch-irc","twitch-tv","twitchbot"],"latest_commit_sha":null,"homepage":"https://joelpurra.com/projects/botten-nappet/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joelpurra.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}},"created_at":"2018-01-18T15:52:11.000Z","updated_at":"2024-01-04T15:49:32.000Z","dependencies_parsed_at":"2022-09-02T12:10:21.440Z","dependency_job_id":null,"html_url":"https://github.com/joelpurra/botten-nappet","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joelpurra%2Fbotten-nappet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joelpurra%2Fbotten-nappet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joelpurra%2Fbotten-nappet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joelpurra%2Fbotten-nappet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joelpurra","download_url":"https://codeload.github.com/joelpurra/botten-nappet/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238574298,"owners_count":19494716,"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","nodejs","server","streaming","twitch","twitch-api","twitch-bot","twitch-irc","twitch-tv","twitchbot"],"created_at":"2024-10-11T14:31:22.501Z","updated_at":"2025-10-27T23:31:23.704Z","avatar_url":"https://github.com/joelpurra.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [botten-nappet](https://joelpurra.com/projects/botten-nappet/)\n\nA Twitch bot and streaming tool.\n\n\n\n## Usage\n\nTo be done.\n\n\n\n## Configuration\n\nThe server code expects these environment variables to be set. See steps below for manual/developer steps to set/retrieve the values.\n\n```shell\nexport TWITCH_APP_CLIENT_ID='configure me'\nexport TWITCH_APP_CLIENT_SECRET='configure me'\nexport TWITCH_APP_OAUTH_REDIRECT_URL='configure me'\nexport TWITCH_USER_NAME='configure me'\nexport VIDY_API_ROOT_URL='https://sandbox.vidy.cn/'\nexport VIDY_API_KEY_ID='sandbox'\nexport VIDY_API_KEY_SECRET='sandbox'\nexport VIDY_VIDEO_LINK_BASE_URL='https://vidy.cn/v/'\nexport VIDY_SYSTEM_UUID='configure me'\nexport BOTTEN_NAPPET_SHARED_LOG_FILE=\"${TMPDIR}.botten-nappet.log\"\nexport BOTTEN_NAPPET_BACKEND_DATABASE_URI=\"nedb://.../path/to/botten-nappet/database-directory\"\n```\n\n\n\n## Installation\n\n```shell\nnpm install\n\nnpm run --silent build\n```\n\n\n\n## Running the server\n\n```shell\nnpm run --silent start\n```\n\n\n\n## Development\n\nFollow [git-flow](https://danielkummer.github.io/git-flow-cheatsheet/) and use [git-flow-avh](https://github.com/petervanderdoes/gitflow-avh).\n\n```shell\n# Make sure git-flow is initialized.\ngit flow init -d\n\n# Clean, test, build, watch javascript code for changes.\nnpm run --silent clean\nnpm run --silent build\nnpm run --silent test\nnpm run --silent watch\n\n# Modify the ZeroMQ port if running multiple instances.\n#export BOTTEN_NAPPET_SHARED_ZMQ_ADDRESS=\"tcp://localhost:61611\"\n\n# Set logging parameters.\nexport BOTTEN_NAPPET_SHARED_LOGGING_LEVEL='trace'\nexport BOTTEN_NAPPET_SHARED_LOG_FILE=\"${TMPDIR}.botten-nappet.log\"\n\n# Start debugger. Connect to it using Google Chrome, see chrome://inspect/\n# https://medium.com/@paul_irish/debugging-node-js-nightlies-with-chrome-devtools-7c4a1b95ae27\n# Run \"debug\" for normal debugging, or \"debug:break\" to break on the first statement.\n# NOTE: pipes log output to a file, which is pretty-printed separately.\nnpm run --silent debug\n\n# New terminal window: watch log file and pretty print.\ntail -f \"$BOTTEN_NAPPET_SHARED_LOG_FILE\" | ./node_modules/.bin/pino\n```\n\n\n\n## Developer environment setup\n\nThe below steps assume a `bash` shell.\n\n\n### Prepare variables\n\n```shell\n# Create a Twitch application, get your client id/secret from there.\nopen 'https://dev.twitch.tv/dashboard/apps/create'\n\n# Your application details.\nexport TWITCH_APP_CLIENT_ID='your twitch client id here'\nexport TWITCH_APP_CLIENT_SECRET='your twitch client secret here'\n\n# Set OAuth landing page for authorized users.\n# NOTE: use the same address here as in the applcation registration.\n# NOTE: this should be one of your own domains/websites.\n# TODO: build a page which accepts the authorized user's code automatically.\nexport TWITCH_APP_OAUTH_REDIRECT_URL='https://example.com/'\n\n# Set username to gain access to.\nexport TWITCH_USER_NAME='your-twitch-username'\n```\n\n\n### Shutting down the development environment\n\nBest practice includes revoking the above temporary development tokens.\n\n```shell\n# Revoke user access token.\n# TODO: curl local development revoke url.\n```\n\n```shell\n# Unset all of the exported variables.\n# NOTE: there might be more custom settings.\nexport -n TWITCH_APP_CLIENT_ID\nexport -n TWITCH_APP_CLIENT_SECRET\nexport -n TWITCH_APP_OAUTH_REDIRECT_URL\nexport -n TWITCH_USER_NAME\nexport -n VIDY_API_ROOT_URL\nexport -n VIDY_VIDEO_LINK_BASE_URL\nexport -n VIDY_API_KEY_ID\nexport -n VIDY_API_KEY_SECRET\nexport -n VIDY_SYSTEM_UUID\nexport -n BOTTEN_NAPPET_SHARED_LOG_FILE\nexport -n BOTTEN_NAPPET_BACKEND_DATABASE_URI\n```\n\n\n\n### Generating dependency graphs\n\nSome dependencies are easier to analyze with some visual aid, in the form of graphs in `.pdf` format.\n\n- Requires [graphviz](https://www.graphviz.org).\n- It's easy to modify the generated `.gv` files to fix layout issues as well as remove/comment out parts of the graph — it can get pretty cluttered.\n- Some parts of the runtime generation can be configured to include/exclude/cluster classes.\n\n\n**Build time module import graphs**\n\n```shell\n# NOTE: generates graphs for the rollup config files.\n# NOTE: see output in rollup.config.*.gv.\n# NOTE: see output in rollup.config.*.gv.pdf.\nnpm run --silent graph\n```\n\n\n**Runtime dependency injection graph**\n\n```shell\n# NOTE: enable dependency injection graph generation.\n# NOTE: see configuration files.\nexport BOTTEN_NAPPET_GENERATE_GRAPH=\"true\"\n\n# NOTE: start the server.\nnpm run --silent start\n\n# NOTE: the graph is written to disk after server shutdown.\n# NOTE: these commands generates most recent graph to pdf.\n# NOTE: see output in dependency-graph.*.gv.\n# NOTE: see output in dependency-graph.*.gv.pdf.\nexport DGGV=\"$(find . -iname 'dependency-graph.*.gv' | sort | tail -n 1)\"\ndot -T \"pdf\" -O \"$DGGV\"\n\necho \"$DGGV\"\nopen \"${DGGV}.pdf\"\n```\n\n\n\n## Acknowledgements\n\n- thor10768765 on Twitch for inspiration and pushing me to start this project.\n\n\n\n---\n\n[botten-nappet](https://joelpurra.com/projects/botten-nappet/) Copyright \u0026copy; 2018 [Joel Purra](https://joelpurra.com/). Released under [GNU Affero General Public License version 3.0 (AGPL-3.0)](https://www.gnu.org/licenses/agpl.html). [Your donations are appreciated!](https://joelpurra.com/donate/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoelpurra%2Fbotten-nappet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoelpurra%2Fbotten-nappet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoelpurra%2Fbotten-nappet/lists"}