# Robus Twitch Category Changer

**URL:** <https://extensions.streamer.bot/t/robus-twitch-category-changer/1804>\
**Category:** Testing\
**Tags:** moderation, chat, twitch\
**Created:** [August 28, 2024, 7:25pm UTC](https://extensions.streamer.bot/t/robus-twitch-category-changer/1804 "2024-08-28T19:25:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fred\_mackay](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/fred_mackay/32/577_2.png) [@fred\_mackay](https://extensions.streamer.bot/u/fred_mackay)\
**Post date:** [August 28, 2024, 7:25pm UTC](https://extensions.streamer.bot/t/robus-twitch-category-changer/1804/1 "2024-08-28T19:25:48Z")

</div>

## Description

A while ago I was trying to use a !setgame command to update my Category in Twitch to “Thank Goodness You’re Here!” and it wouldn’t work, no matter how I typed it. The game was present in the Creator Dashboard when I searched, but chat commands refused to work. So I coded up a robust way of doing it.  
It requires you to create an App in Twitch Dev in order to get a Client ID and Client Secret, and trust me, it’s easier than it sounds.

## Video Tutorial

> Step-by-step video showing you how to get the Client ID and Secret as per the IGDB Docs, how to store them in Streamerbot, and how to install and test the extension.

[![](https://extensions.streamer.bot/uploads/default/original/2X/0/00b02d194cbe5b828ffe5d1acce777b5e703fec5.jpeg "How to set up the Robust Twitch Category Changer") ](https://www.youtube.com/watch?v=wjscIwLOWZo)

## Download File

> [Robust Category Changer.sb](https://extensions.streamer.bot/uploads/short-url/cRKaPR6OzH4vt4Z45F87v1Hz2jB.sb) (6.1 KB)

## Installation

1. First we need to get a Client ID and Client Secret from Twitch, you can do that by following this tutorial, or following the video above:

> The Internet Game Database API website has step by step instructions on how-to get a Client ID and Client Secret: [https://api-docs.igdb.com/#getting-started](https://api-docs.igdb.com/#getting-started)

1. Next we need to add the Client ID, and Client Secret to our Variables in Streamer.bot  

2. In Streamer.bot click the `Import` button in the top menu. Drag the **.sb** file into the `Import String` field.  

3. Your Action should have imported, and should look something like this!  

4. Remember to go to your ‘Commands’ tab and Right Click → Enable the newly created “Change Category” action.  

5. You’re done! Assuming your Streamer.bot is hooked up to your Twitch Channel correctly, you should be able to change the category simply by typing something like:

> !setgame Just Chatting

or

> !changegame Halo 3

## Happy Category changing!

---

<div class="post-metadata">

**Author:** ![pwnyy](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/pwnyy/32/2970_2.png) [@pwnyy](https://extensions.streamer.bot/u/pwnyy)\
**Post date:** [August 28, 2024, 9:20pm UTC](https://extensions.streamer.bot/t/robus-twitch-category-changer/1804/2 "2024-08-28T21:20:57Z")

</div>

A few things you could probably consider, there is no direct need to create a developer key etc, you should be able to use:

```auto
string tokenValue = CPH.TwitchOAuthToken;
string clientIdValue = CPH.TwitchClientId;

```

which are methods build into Streamer.bot. Another thing I recommend looking into would be the following, as you are currently using “using HttpClient” and should be changed to accordingly:

> [@HttpClient and you](https://extensions.streamer.bot/t/httpclient-and-you/1369):
>
> In your C# journey, you may require the use of HttpClient. You may find examples that have you put HttpClient in a using statement. It’s been said that this is not proper practice. Sources [You’re using HttpClient wrong and it is destabilizing your software](https://www.aspnetmonsters.com/2016/08/2016-08-27-httpclientwrong/)[You're (probably still) using HttpClient wrong and it is destabilizing your software](https://josef.codes/you-are-probably-still-using-httpclient-wrong-and-it-is-destabilizing-your-software/)Summary Using HttpClient within a using() statement is not recommended due to the potential for socket exhaustion and performance degradation caused by fre…
