Skip to content

Commit 16234da

Browse files
committed
add for communities
1 parent ac5af93 commit 16234da

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

resources/lib/twitch/api/v5/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@
1212
from twitch.api.v5 import teams # NOQA
1313
from twitch.api.v5 import users # NOQA
1414
from twitch.api.v5 import videos # NOQA
15+
from twitch.api.v5 import communities # NOQA
1516
from twitch.api.v5.root import root # NOQA

resources/lib/twitch/api/v5/communities.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ def top(limit=10, cursor=0):
1515

1616
@query
1717
def by_name(name):
18-
q = Qry('communities?name={communities}')
19-
q.add_urlkw(keys.COMMUNITIES, name)
18+
q = Qry('communities')
19+
q.add_param(keys.NAME, name)
2020
return q
2121

2222

resources/lib/twitch/api/v5/streams.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ def by_channel(identification):
1414

1515

1616
@query
17-
def all(game=None, channel=None, limit=25, offset=0, client_id=None):
17+
def all(game=None, channel=None, community_id=None, limit=25, offset=0, client_id=None):
1818
q = Qry('streams')
1919
q.add_param(keys.GAME, game)
2020
q.add_param(keys.CHANNEL, channel)
21+
q.add_param(keys.COMMUNITY_ID, community_id)
2122
q.add_param(keys.LIMIT, limit, 25)
2223
q.add_param(keys.OFFSET, offset, 0)
2324
q.add_param(keys.CLIENT_ID, client_id)

resources/lib/twitch/keys.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
BROADCASTS = 'broadcasts'
1010
CHANNEL = 'channel'
1111
COMMUNITIES = 'communities'
12+
COMMUNITY_ID = 'community_id'
1213
CURSOR = 'cursor'
1314
CLIENT_ID = 'client_id'
1415
DIRECTION = 'direction'

0 commit comments

Comments
 (0)