Skip to content

Commit

Permalink
Merge pull request #104 from aviadsteps/patch-1
Browse files Browse the repository at this point in the history
Update duolingo.py
  • Loading branch information
SpangleLabs authored Sep 28, 2021
2 parents 95a1f44 + d622829 commit 9e552ba
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 9e552ba

Please sign in to comment.