Skip to content

Commit

Permalink
Update duolingo.py
Browse files Browse the repository at this point in the history
Adding buy weekend amulet feature
  • Loading branch information
aviadsteps authored Apr 9, 2021
1 parent 762c0b0 commit d622829
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions duolingo.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,21 @@ def buy_streak_freeze(self):
return True
except AlreadyHaveStoreItemException:
return False

def buy_weekend_amulet(self):
"""
figure out the users current learning language
use this one as parameter for the shop
"""
lang = self.get_abbreviation_of(self.get_user_info()['learning_language_string'])
if lang is None:
raise DuolingoException('No learning language found')
try:
self.buy_item('weekend_amulet', lang)
return True
except AlreadyHaveStoreItemException:
return False


def _switch_language(self, lang):
"""
Expand Down

0 comments on commit d622829

Please sign in to comment.