Skip to content

Commit b5ece74

Browse files
committed
add missing language parameter that was added to clips v5
1 parent af279df commit b5ece74

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# https://dev.twitch.tv/docs/v5/reference/clips/
33

44
from twitch import keys
5-
from twitch.api.parameters import Boolean, ClipPeriod, Cursor
5+
from twitch.api.parameters import Boolean, ClipPeriod, Cursor, Language
66
from twitch.queries import V5Query as Qry
77
from twitch.queries import query
88

@@ -17,22 +17,25 @@ def by_slug(slug):
1717

1818
# required scope: None
1919
@query
20-
def get_top(channels=None, games=None, period=ClipPeriod.WEEK, trending=Boolean.FALSE, cursor='MA==', limit=10):
20+
def get_top(channels=None, games=None, period=ClipPeriod.WEEK, trending=Boolean.FALSE,
21+
language=Language.ALL, cursor='MA==', limit=10):
2122
q = Qry('clips/top')
2223
q.add_param(keys.CHANNEL, channels, None)
2324
q.add_param(keys.GAME, games, None)
2425
q.add_param(keys.PERIOD, ClipPeriod.validate(period), ClipPeriod.WEEK)
2526
q.add_param(keys.TRENDING, Boolean.validate(trending), Boolean.FALSE)
27+
q.add_param(keys.LANGUAGE, Language.validate(language), Language.ALL)
2628
q.add_param(keys.LIMIT, limit, 10)
2729
q.add_param(keys.CURSOR, Cursor.validate(cursor), 'MA==')
2830
return q
2931

3032

3133
# required scope: user_read
3234
@query
33-
def get_followed(trending=Boolean.FALSE, cursor='MA==', limit=10):
35+
def get_followed(trending=Boolean.FALSE, language=Language.ALL, cursor='MA==', limit=10):
3436
q = Qry('clips/followed')
3537
q.add_param(keys.TRENDING, Boolean.validate(trending), Boolean.FALSE)
38+
q.add_param(keys.LANGUAGE, Language.validate(language), Language.ALL)
3639
q.add_param(keys.LIMIT, limit, 10)
3740
q.add_param(keys.CURSOR, Cursor.validate(cursor), 'MA==')
3841
return q

0 commit comments

Comments
 (0)