{"id":19469427,"url":"https://github.com/adambirds/pythonrobot-twitch-bot","last_synced_at":"2025-04-25T11:33:17.366Z","repository":{"id":41238685,"uuid":"458885413","full_name":"adambirds/pythonrobot-twitch-bot","owner":"adambirds","description":"PythonRobot Twitch Bot","archived":false,"fork":false,"pushed_at":"2022-07-22T23:52:46.000Z","size":163,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T21:06:39.490Z","etag":null,"topics":["bot","python","python3","twitch","twitch-bot","twitchio"],"latest_commit_sha":null,"homepage":"","language":"Python","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/adambirds.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/contributing/commit-guidelines.md","funding":"FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"adambirds"}},"created_at":"2022-02-13T17:47:16.000Z","updated_at":"2024-09-26T20:49:51.000Z","dependencies_parsed_at":"2022-07-18T08:17:17.023Z","dependency_job_id":null,"html_url":"https://github.com/adambirds/pythonrobot-twitch-bot","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/adambirds%2Fpythonrobot-twitch-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adambirds%2Fpythonrobot-twitch-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adambirds%2Fpythonrobot-twitch-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adambirds%2Fpythonrobot-twitch-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adambirds","download_url":"https://codeload.github.com/adambirds/pythonrobot-twitch-bot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250808449,"owners_count":21490668,"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","python","python3","twitch","twitch-bot","twitchio"],"created_at":"2024-11-10T18:50:54.190Z","updated_at":"2025-04-25T11:33:16.981Z","avatar_url":"https://github.com/adambirds.png","language":"Python","readme":"# PythonRobot TwitchBot\n[![code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![mypy coverage](https://img.shields.io/badge/mypy-100%25-green.svg)](https://github.com/python/mypy)\n![GitHub Sponsors](https://img.shields.io/github/sponsors/adambirds)\n\nDeveloped for the channels of [PythonPhil](https://twitch.tv/pythonphil) and [CodingAndGamingWithAdam](https://twitch.tv/codingandgamingwithadam).\n\n## Support\nFor support using this bot, please join our [official support server](https://discord.gg/f5veJaa4ZX) on [Discord](https://discord.com).\n\n[![discord](https://img.shields.io/discord/941885906443468880?color=%237289DA\u0026label=Coding%20With%20Adam\u0026logo=discord\u0026logoColor=white)](https://discord.gg/f5veJaa4ZX)\n\n## Source\nThe source code can be found [here](https://github.com/adambirds/pythonrobot-twitch-bot).\n\nContributions welcome and gratefully appreciated!\n\n## Requirements\nPython 3 (Version 3.6 or later).\n\n## Installation\n\nThis has only been tested on Linux, so preferably use Linux or WSL 2 if on Windows.\n\nNavigate to where you will store the bot files, then run:\n\n```\ngit clone git@github.com:adambirds/pythonrobot-twitch-bot.git\n```\n\nThen run:\n\n```\ntools/setup/prep-prod-environment\n```\n\nThen run:\n\n```\ncp example-config.yaml config.yaml\n```\n\nYou will then need to edit config.yaml to your needs. You shouldn't delete any of the keys, however any of the keys under `SOCIALS` can be set to `\"\"` which will inform the bot that you don't have an account.\n\nThe `ACCESS_TOKEN` key can be generated using this [generator](https://twitchtokengenerator.com).\n\nThe `CLIENT_ID` and `CLIENT_SECRET` keys have to be got from creating and registering your own application at [dev.twitch.tv](https://dev.twitch.tv).\n\nThe `SECRET_STRING` key can be set to any string you like but this cannot be changed without a lot of difficulty down the line for you. For security we highly reccommend that this is set to something long, ideally a randomly generated string of characters.\n\nThe `CALLBACK_URL` key should be set to the domain you wish Twitch to send the webhooks to for which we will now setup a web server for.\n\nThe `PORT` key should be set to a port number that the internal web server that the bot creates will listen on. By default this is set to `4000` in the config file.\n\n**Twitch** requires your callback URL to be accessible via `https://` with an `SSL` certificate on port `443`. The bot doesn't support this so we need set up a reverse proxy to handle this for us. For this I reccommend using **Nginx** which you can install with the below command:\n\n```\napt-get install nginx\n```\n\nFor your SSL certificate you can use any valid SSL as long as it isn't self-signed. For a free SSL certificate I reccomend that you use [Lets Encrypt](https://letsencrypt.org). You can find the instructions on how to generate your SSL [here](https://certbot.eff.org).\n\nI have included an example nginx config file [here](https://github.com/adambirds/pythonrobot-twitch-bot/blob/main/example-nginx-virtualhost.conf). Once you have this running the only thing then left is to setup your bot to run as a service if you wish which you can do by amending the `./pythonrobot-twitch-bot.service` file with your working directorys and copying it using the following command:\n\n```\ncp ./pythonrobot-twitch-bot.service /lib/systemd/system/\n```\n\nThen run:\n\n```\nsystemctl daemon-reload\n```\n\nThen run:\n\n```\nsystemctl start pythonrobot-twitch-bot\n```\n\nAnd then to ensure it starts when your server does run:\n\n```\nsystemctl enable pythonrobot-twitch-bot\n```\n\n## Commands and Events\n\n### Commands\n\nThe bot supports the following commands:\n\n| Command | Aliases | Example | Permissions | Purpose |\n|-------- | ------- | ------- | ----------- | ------- |\n| !8ball | | `!8ball Am I amazing?` | Everyone | The bot replies to a yes or no question. |\n| !age | | `!age` | Everyone | The bot replies with a random age. |\n| !ban | | `!ban @adamistesting` or `!ban @adamistesting spamming channel`| Moderators | Ban user with or without a reason. |\n| !calculator | !calc | `!calculator 4 + 4` | Everyone | Performs a simple calculation. Supports +, -, *, / |\n| !dice | !roll | `!dice` | Everyone | Random number between 1 and 6. |\n| !discord | | `!discord` | Everyone | The streamers discord link. |\n| !facebook | !fb | `!facebook` | Everyone | The streamers facebook link. |\n| !formatpy | | `!formatpy` | Everyone | Reminds someone how to format in python |\n| !getthisbot | | `!getthisbot` | Everyone | The link to the bots github |\n| !gitcheatsheet | | `!gitcheatsheet` | Everyone | The bot will reply with link to git cheat sheet. |\n| !github | | `!github` | Everyone | The streamers github link. |\n| !hello | | `!hello` | Everyone | The bot replies hello |\n| !help | !commands | `!help` | Everyone | The bot replies with the link to these commands. |\n| !instagram | !ig , !insta | `!instagram` | Everyone | The streamers instagram link. |\n| !patreon | | `!patreon` | Everyone | The streamers patreon link. |\n| !pycheatsheet | | `!pycheatsheet` | Everyone | The bot replies with the link to a Python cheat sheet. |\n| !project | | `!project` | Everyone | The bot replies about information on the current project. |\n| !pyvenv | !pyenv, !venv, !virtualenv | `!pyvenv` | Everyone | The bot replies with the command to create a Python virtual environment. |\n| !quote | | `!quote` | Everyone | The bot replies with a random quote. |\n| !reddit | | `!reddit` | Everyone | The streamers reddit link. |\n| !shoutout | !so | `!shoutout pythonphil` | Moderators | Shoutout a fellow streamer |\n| !socials | !links | `!socials` | Everyone | The streamers social mnedia links. |\n| !tiktok | | `!tiktok` | Everyone | The streamers tiktok link. |\n| !time | !date , !datetime | `!time Europe/London` | Everyone | Current time anywhere in world |\n| !timeout | !to | `!timeout @adamistesting 10` or `!timeout @adamistesting 10 spamming channel` | Moderators | Timeout user for specified number of seconds with or without a reason. |\n| !twitter | | `!twitter` | Everyone | The streamers twitter link. |\n| !unban | | `!unban @adamistesting` | Moderators | Unban user. |\n| !uptime | | `!uptime` | Everyone | Display how long the streamer has been streaming for. |\n| !website | | `!website` | Everyone | The streamers website link. |\n| !youtube | | `!youtube` | Everyone | The streamers youtube link. |\n\n### Events\nThe bot also currently reacts to the following events:\n\n- New Follower - The bot will thank the follower and if the stream has a discord, give them the link.\n- Channel Raid - The bot will shoutout the raider, thank them, and announce how many views they brought with them.\n\n## License\n\nThis project is released under the [GNU GENERAL PUBLIC LICENSE v3](https://github.com/adambirds/pythonrobot-twitch-bot/blob/main/LICENSE).\n\n## Contributing\n\nAnybody is welcome to contribute to this project. I just ask that you check out our contributing guidelines\n[here](https://github.com/adambirds/pythonrobot-twitch-bot/blob/main/docs/contributing/contributing.md) first.\n","funding_links":["https://github.com/sponsors/adambirds"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadambirds%2Fpythonrobot-twitch-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadambirds%2Fpythonrobot-twitch-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadambirds%2Fpythonrobot-twitch-bot/lists"}