Communities

class twitch.api.communities.Communities

This class provides methods for easy access to Twitch Communities API.

classmethod get_by_name(community_name)

Gets a specified community.

Parameters:community_name (string) – Name of the community
classmethod get_by_id(community_id)

Gets a Community object based on specified user id.

Parameters:community_id (string) – Community ID
classmethod create(name, summary, description, rules)

Creates a community.

Parameters:
  • name (string) – Community name.
  • summary (string) – Short description of the community.
  • description (string) – Long description of the community.
  • rules (string) – Rules displayed when viewing a community page.
classmethod update(community_id, summary, description, rules, email)

Updates a community.

Parameters:
  • community_id (string) – Community ID
  • summary (string) – Short description of the community.
  • description (string) – Long description of the community.
  • rules (string) – Rules displayed when viewing a community page.
  • email (string) – Email address of the community owner.
>>> from twitch import TwitchClient
>>> client = TwitchClient('<my client id>', '<my oauth token>')
>>> community = client.communities.update(12345, 'foo', 'bar')