Skip to content

Commit 8b8b61a

Browse files
authored
Merge pull request #112 from anxdpanic/pr_isengard
update subscription endpoints
2 parents ea0543a + fc10905 commit 8b8b61a

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

resources/lib/twitch/api/helix/subscriptions.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,27 @@
1010
See LICENSES/GPL-3.0-only for more information.
1111
"""
1212

13-
from ..parameters import ItemCount
13+
from ..parameters import Cursor, IntRange, ItemCount
1414
from ... import keys, methods
1515
from ...queries import HelixQuery as Qry
1616
from ...queries import query
1717

1818

1919
# required scope: channel:read:subscriptions
2020
@query
21-
def get_broadcaster_subscriptions(broadcaster_id):
21+
def get_broadcaster_subscriptions(broadcaster_id, user_id=list(), after='MA==', first=20):
2222
q = Qry('subscriptions', use_app_token=False, method=methods.GET)
2323
q.add_param(keys.BROADCASTER_ID, broadcaster_id)
24-
24+
q.add_param(keys.AFTER, Cursor.validate(after), 'MA==')
25+
q.add_param(keys.FIRST, IntRange(1, 100).validate(first), 20)
26+
q.add_param(keys.USER_ID, ItemCount().validate(user_id), list())
2527
return q
2628

2729

2830
# required scope: channel:read:subscriptions
2931
@query
3032
def get_user_subscriptions(broadcaster_id, user_id):
31-
q = Qry('subscriptions', use_app_token=False, method=methods.GET)
33+
q = Qry('subscriptions/user', use_app_token=False, method=methods.GET)
3234
q.add_param(keys.BROADCASTER_ID, broadcaster_id)
3335
q.add_param(keys.USER_ID, ItemCount().validate(user_id), list())
3436

0 commit comments

Comments
 (0)