{"id":15423847,"url":"https://github.com/negativeeddy/twitchadapter","last_synced_at":"2026-02-02T02:31:35.002Z","repository":{"id":56576792,"uuid":"278951742","full_name":"negativeeddy/TwitchAdapter","owner":"negativeeddy","description":"An adapter to connect Bot Framework bots to Twitch","archived":false,"fork":false,"pushed_at":"2024-07-09T21:23:17.000Z","size":351,"stargazers_count":2,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-19T18:42:05.305Z","etag":null,"topics":["bot-framework","bots","dotnet","twitch","twitch-bot"],"latest_commit_sha":null,"homepage":"","language":"C#","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/negativeeddy.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}},"created_at":"2020-07-11T22:30:02.000Z","updated_at":"2020-11-10T16:50:58.000Z","dependencies_parsed_at":"2024-10-20T05:22:53.636Z","dependency_job_id":"a577389a-c468-45a0-80fe-d62ed113da02","html_url":"https://github.com/negativeeddy/TwitchAdapter","commit_stats":{"total_commits":56,"total_committers":2,"mean_commits":28.0,"dds":0.125,"last_synced_commit":"fc919cb2befa0b88d46730d891693b8966ab5b33"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/negativeeddy/TwitchAdapter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/negativeeddy%2FTwitchAdapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/negativeeddy%2FTwitchAdapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/negativeeddy%2FTwitchAdapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/negativeeddy%2FTwitchAdapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/negativeeddy","download_url":"https://codeload.github.com/negativeeddy/TwitchAdapter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/negativeeddy%2FTwitchAdapter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29001654,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T01:32:03.847Z","status":"online","status_checked_at":"2026-02-02T02:00:07.448Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-framework","bots","dotnet","twitch","twitch-bot"],"created_at":"2024-10-01T17:44:33.671Z","updated_at":"2026-02-02T02:31:34.988Z","avatar_url":"https://github.com/negativeeddy.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bot Framework Twitch Adapter\n\nThe TwitchAdapter is a C# component which allows you to add Twitch as an endpoint for a bots built with the [Microsoft Bot Framework SDK](https://github.com/Microsoft/botframework-sdk). \nAll Twitch integration is achieved through the [Twitch IRC interface](https://dev.twitch.tv/docs/irc). The C# API support for the IRC interface is provided by the [TwitchLib Client](https://github.com/TwitchLib).\n\n# Project Structure\n**NegativeEddy.Bots.Twitch** - contains the Twitch adapter\n\n**NegativeEddy.Bots.Twitch.AspNetCore** - contains support for ASP.NET Core integration\n\n**NegativeEddy.Bots.Twitch.AspNetHost** - an ASP.NET Core sample which hosts the bot as a background service\n\n**NegativeEddy.Bots.Twitch.BlazorHost** - an ASP.NET Core sample which hosts the bot as a background service along side a server side Blazor app. The Blazor app has a simple UI that allows some configuration of the TwitchAdapter. This project also uses a more realistic and flexible bot implementation from defined in [NegativeEddy.Bots.Twitch.SampleBot](NegativeEddy.Bots.Twitch.SampleBot).\n\n**NegativeEddy.Bots.Twitch.ConsoleHost** - a .NET Core Console sample which hosts the bot. The console accepts a few commands to configure the TwitchAdapter\n\n**NegativeEddy.Bots.Twitch.SampleBot** - a more realistic sample bot implementation with '!' style commands. This is the bot that is hosted by the BlazorHost sample.\n\n# Requirements\nTo register a bot with Twitch\n\n    1. create a twitch account for the bot's identity\n       - make note of the account's ID\n    2. enable 2-factor auth (required to manage twitch apps)\n    3. create an auth token at https://twitchapps.com/\n        - make note of the token\n    4. register an app at https://dev.twitch.tv/console\n        - make note of the client ID\n    5. update appsettings.json with the new values\n\nAppSettings fields required\n``` \n{\n  \"twitchBot\": {\n      \"UserId\": \"[bot's user ID]\",\n      \"ClientId\": \"[client ID]\",\n      \"OAuthToken\": \"[auth Token]\"\n  }\n}\n```\n\n## Usage in an ASP.NET app\nAs part of the services configuration\n 1. register your bot as an IBot inteface \n 2. call the AddTwitchBotAdapter() extension method with a populated TwitchAdapterSettings object.\n \n```\npublic void ConfigureServices(IServiceCollection services)\n{\n    ...\n    services.AddTransient\u003cIBot, TwitchBot\u003e(); \n \n    var twitchSettings = new TwitchAdapterSettings();\n    Configuration.GetSection(\"twitchBot\").Bind(twitchSettings);\n    services.AddTwitchBotAdapter(twitchSettings);\n    ...\n}\n```\n\nThis will register the TwitchBotWorker background service which will set up the TwitchBotAdapter connected to your IBot implementation.\n\nThe TwitchBotAdapter has methods on it to manage the twitch client directly if needed. e.g. Joining/Leaving channels. It is registered in the services collection as a singleton. To access it, just inject it and call the methods on it.\n\n# Optional Configuration\nThe twitchBot settings section has optional values that will override the adapter defaults\n```\n{\n  \"twitchBot\": {\n      \"UserId\": \"[bot's user ID]\",\n      \"ClientId\": \"[client ID]\",\n      \"OAuthToken\": \"[auth Token]\"\n      \"InitialChannels\" : [\"channel1\", \"channel2\"],\n      \"ThrottlingMessagesAllowedInPeriod\": \"750\",\n      \"ThrottlingPeriodInSeconds\": \"30\"\n  }\n}\n```\n### InitialChannels\ndefault value: none\n\nThis parameter is a string array of channel names that the twitch adapter will connect to after initialization. If left empty, no channels are connected by default.\n### ThrottlingMessagesAllowedInPeriod \ndefault value: 750\n### ThrottlingPeriodInSeconds\ndefault value: 30\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnegativeeddy%2Ftwitchadapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnegativeeddy%2Ftwitchadapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnegativeeddy%2Ftwitchadapter/lists"}