async def on_message(message): if message.content.lower().startswith('!add'): print('hello') api = steam.WebAPI("C136679DFD24DD703C2BBAE308FD4F25") steam_name = message.content.strip("!add ") steamID = api.ISteamUser.ResolveVanityURL( vanityurl="alrounder80" ) #!a.format(steam_name)) #hard code this for now steamID = steamID['response'] steamID = steamID['steamid'] print(steamID) await bot.send_message(message.channel, "steam://url/SteamIDPage/{}".format(steamID))
#!/usr/bin/env python3 # -*- coding: utf-8 -*- #import re import os import sys import bottle #from bottle import debug from bottle import default_app, run from bottle import request from bottle import static_file from bottle import jinja2_view import steam api = steam.WebAPI("ze api key goes here") path = os.path.abspath(__file__) dir_path = os.path.dirname(path) app = application = default_app() @app.get('/') @jinja2_view('index.html') def index(): return {} @app.post('/') @jinja2_view('index_result.html')
def validateWebApiKey(apikey): steamapi.WebAPI(apikey)
def __init__(self, apikey): self.api = steamapi.WebAPI(apikey)
def __init__(self, settings): self.api = steam.WebAPI(settings.API_KEY) self.steam_url = settings.URL
import SteamUsr # SUMMARY: 1on1 builds a single deep network of both # users friends lists, which displays the # mutual friends of each user parser = ap.ArgumentParser() parser.add_argument("rootUser", metavar="R", type=str) parser.add_argument("friend", metavar="F", type=str) args = parser.parse_args() f = open("key.txt", "r") key = f.read() f.close() api = steam.WebAPI(key) f_graph = nx.Graph() # Handle vanity URLs AND steamID steamID = args.rootUser try: steamID = int(args.rootUser) except Exception: steamID = api.ISteamUser.ResolveVanityURL( vanityurl=args.rootUser)["response"]["steamid"] otherID = args.friend try: otherID = int(args.friend) except Exception:
def connect(self): # TODO: Error handling self.steam_api = steam.WebAPI(key=self.config['steam_api_token']) logging.info('Connected to Steam API.') return