def steam(inp, title, _cache={}):
"""Find steam games by their title."""
if not _cache:
data = requests.get(
'http://api.steampowered.com/ISteamApps/GetAppList/v0001/').json()
data = data['applist']['apps']['app']
data = {i['name'].lower(): i['appid'] for i in data}
_cache.update(data)
if title in _cache:
return get_steam_game(_cache[title])
for k, v in _cache.items():
if title in k:
return get_steam_game(v)
return lex.steam.not_found
###############################################################################
评论列表
文章目录