@@ -129,11 +129,17 @@ def get_projected_total(lineup):
129129 total_projected = 0
130130 for i in lineup :
131131 if i .slot_position != 'BE' :
132- if i .points != 0 :
132+ if i .points != 0 or i . game_played > 0 :
133133 total_projected += i .points
134134 else :
135135 total_projected += i .projected_points
136136 return total_projected
137+
138+ def all_played (lineup ):
139+ for i in lineup :
140+ if i .slot_position != 'BE' and i .game_played < 100 :
141+ return False
142+ return True
137143
138144def get_matchups (league , week = None ):
139145 #Gets current week's Matchups
@@ -153,11 +159,11 @@ def get_close_scores(league, week=None):
153159 for i in matchups :
154160 if i .away_team :
155161 diffScore = i .away_score - i .home_score
156- if - 16 < diffScore < 16 :
162+ if ( - 16 < diffScore <= 0 and not all_played ( i . away_lineup )) or ( 0 <= diffScore < 16 and not all_played ( i . home_lineup )) :
157163 score += ['%s %.2f - %.2f %s' % (i .home_team .team_abbrev , i .home_score ,
158164 i .away_score , i .away_team .team_abbrev )]
159165 if not score :
160- score = [ 'None' ]
166+ return ( '' )
161167 text = ['Close Scores' ] + score
162168 return '\n ' .join (text )
163169
@@ -271,7 +277,7 @@ def bot_main(function):
271277 if swid == '{1}' and espn_s2 == '1' :
272278 league = League (league_id , year )
273279 else :
274- league = League (league_id , year , espn_s2 , swid )
280+ league = League (league_id , year , espn_s2 = espn_s2 , swid = swid )
275281
276282 test = False
277283 if test :
0 commit comments