Storycraft: don't flood the target with storycraft_listgames, display only ids if count > 5
This commit is contained in:
parent
fd22cb64d4
commit
797f660a9e
@ -288,15 +288,18 @@ class Storycraft(Module):
|
||||
|
||||
if category == 'open':
|
||||
games = self._get_open_games()
|
||||
|
||||
gamestrs = []
|
||||
for game in games:
|
||||
gamestrs.append(self._get_game_summary(game))
|
||||
|
||||
return '\n'.join(gamestrs)
|
||||
elif category == 'in progress':
|
||||
games = self._get_in_progress_games()
|
||||
|
||||
if len(games) > 5:
|
||||
# just list the game ids
|
||||
gameids = []
|
||||
for game in games:
|
||||
gameids.append(str(game.id))
|
||||
|
||||
return 'Too many to list! ids: ' + ','.join(gameids)
|
||||
else:
|
||||
# show game details, since there's not many
|
||||
gamestrs = []
|
||||
for game in games:
|
||||
gamestrs.append(self._get_game_summary(game))
|
||||
|
Loading…
Reference in New Issue
Block a user