{"id":13758479,"url":"https://github.com/flazer/twitchbot","last_synced_at":"2025-05-10T08:30:27.085Z","repository":{"id":56417288,"uuid":"273758374","full_name":"flazer/twitchbot","owner":"flazer","description":"Just a small and basic PHP twitchbot to send responses based on pattern matching","archived":false,"fork":false,"pushed_at":"2020-11-09T10:32:21.000Z","size":14,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-05T03:05:26.969Z","etag":null,"topics":["bot","commands","faq","php","regex","twitch"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/flazer.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":"2020-06-20T17:55:36.000Z","updated_at":"2024-01-09T09:54:08.000Z","dependencies_parsed_at":"2022-08-15T18:20:26.729Z","dependency_job_id":null,"html_url":"https://github.com/flazer/twitchbot","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/flazer%2Ftwitchbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flazer%2Ftwitchbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flazer%2Ftwitchbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flazer%2Ftwitchbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flazer","download_url":"https://codeload.github.com/flazer/twitchbot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253389402,"owners_count":21900754,"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","commands","faq","php","regex","twitch"],"created_at":"2024-08-03T13:00:30.918Z","updated_at":"2025-05-10T08:30:26.739Z","avatar_url":"https://github.com/flazer.png","language":"PHP","funding_links":["http://paypal.me/flazer'","http://paypal.me/flazer"],"categories":["Libraries"],"sub_categories":["PHP"],"readme":"# Twitch FAQ Bot\n\n[Twitch FAQ Bot](https://github.com/minicli/minicli) is just another, small bot for Twitch (irc in general) to answer frequently asked questions automatically.\nIt's based on minicli, an experimental dependency-free toolkit for building CLI-only applications in PHP created by [@erikaheidi](https://twitter.com/erikaheidi).\nFind out more about [minicli](https://github.com/minicli/minicli).\n\n### Why Twitch FAQ Bot\n\nWhen I stream my content on Twitch it happens a lot, that people are asking the same questions over and over again. I can not blame them, but it's a kind of frustrating\nto repeat yourself over and over again. I searched for a solution in [Nightbot](https://nightbot.tv) and [Moobot](http://moo.bot/), but couldn't find any. So I wrote my own bot.\nThis bot is able to parse every written chatmessage and tries to find known patterns, so that it can answer with a predefined text.\n\n### Requirements\n - PHP \u003e= 7.3\n\n## Getting Started\n\nYou'll need `php-cli` and [Composer](https://getcomposer.org/) to get started.\n\nDownload the repo and install all dependecies\n\n```\ncomposer install\n```\n\nYou'll find a configuration example in app/Config/. Just rename the file and edit it:\n```\ncd twitchbot/app/Config\nmv App.example.php App.php\n```\n\nEditing the config:\n```php\nreturn [\n    'twitch' =\u003e [\n       'host' =\u003e 'irc.chat.twitch.tv'\n       'port' =\u003e 6667,\n       'twitch_user' =\u003e 'TWITCH_USERNAME',\n       'twitch_channel' =\u003e 'TWITCH_CHANNEL',\n       'twitch_oauth' =\u003e 'TWITCH_OAUTH_TOKEN', //Get OauthToken here: https://twitchapps.com/tmi/\n    ],\n\n    'patterns' =\u003e [\n        [\n            'pattern' =\u003e ['language', 'code'],\n            'response' =\u003e \"It is PHP, baby!\",\n            'cooldown' =\u003e 5\n        ],\n        [\n            'pattern' =\u003e '/(?i)(?=.*script)(?=.*language)/',\n            'response' =\u003e \"PHP. Do you speak it?!\",\n            'cooldown' =\u003e 5\n        ]\n    ],\n\n    'commands' =\u003e [\n        'ping' =\u003e [\n            'response' =\u003e 'pong!',\n            'cooldown' =\u003e 5\n        ],\n        'donate' =\u003e [\n            'response' =\u003e 'Awww. Thank you. Just go to: http://paypal.me/flazer',\n            'cooldown' =\u003e 5\n        ]\n    ]\n\n```\n\nTo connect to Twitch, you'll need an OAuth-Token. To do so, just click [here](https://twitchapps.com/tmi/) and follow the instructions.  \nReplace `TWITCH_OAUTH_TOKEN` with the generated token and `TWITCH_USERNAME` with yours. `TWITCH_CHANNEL` must be replaced with the streamer's username \nthe bot should join.\n\n## Starting\nOnce the installation is finished, you can run it with `minicli`:\n\n```\ncd twitchbot\n./minicli twitch\n```\n\n## Patterns\n\nTo add a FAQ, you just have to add a new entry in config's patterns section.\nYou can write your own regular expression pattern, or just add a list of words (as an array), which have to be in the received message, so the bot will answer with it's given response.\nIf you are not familar with writing regex, just use the first example in the pattern section.  \nEvery pattern has a cooldown. The value represents seconds.  \nIf the bot can't find any specification, it'll take 5 seconds as default.\n\n\n## Commands\n\nYou can add a new command by just expanding the commands section. Just copy the ping example and edit, so that it belongs your needs.  \nDon't write an exclamation mark in front. This is done automatically while checking the received chat message.\nTo trigger the ping-command just write !ping into the chat window.\nEvery command has a cooldown. The value represents seconds.  \nIf the bot can't find any specification, it'll take 5 seconds as default.\n\n## Links  \n\nDo you have an idea or problem? Want to build any kind of software?  \nContact the best problem-solving-company in the world: [Frozen Donkey](https://frozendonkey.com/).  \n  \nThanks to [@erikaheidi](https://twitter.com/erikaheidi) for her awesome work on minicli! \n\n## Disclaimer\nThis project does not use or include any resource from Twitch.\nUse this project at your own risc. The authors and contributors will not be able to provide any help if Twitch complains about usage or banning.\n\n## Donations\n\nIf you like the project (or me) feel free to donate:  \n[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](http://paypal.me/flazer)\n\n## Subscribe\nFollow and subscribe on twitch: [https://www.twitch.tv/chrisfigge](https://www.twitch.tv/chrisfigge) \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflazer%2Ftwitchbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflazer%2Ftwitchbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflazer%2Ftwitchbot/lists"}