def followChannel(name):
username, userId = user(oauth)
channelId = getChannelId(name)
URL = f"https://api.twitch.tv/helix/users/follows?from_id={userId}&to_id={channelId}"
Headers = {"Accept": "application/vnd.twitchtv.v5+json", "Client-ID": clientId, "Authorization": "Bearer
" + oauth}
r = requests.get(URL, headers=Headers)
data = r.json()
print(data)
I tried using this code to follow a user but it didn’t work. I get this response:
{'total': 0, 'data': [], 'pagination': {}}
How do you follow another account using the twitch api?