A modern, easy to use, and async ready package to interact with the Steam API. Heavily inspired by discord.py.
async
/await
syntaxPython 3.10 or higher is required
To install the library just run either of the following commands:
# Linux/macOS
python3 -m pip install -U steamio
# Windows
py -m pip install -U steamio
Or for the development version.
# Linux/macOS
python3 -m pip install -U "steamio @ git+https://github.com/Gobot1234/steam.py@main"
# Windows
py -m pip install -U "steamio @ git+https://github.com/Gobot1234/steam.py@main"
import steam
class MyClient(steam.Client):
async def on_ready(self) -> None:
print("Logged in as", self.user)
async def on_trade(self, trade: steam.TradeOffer) -> None:
if not trade.is_our_offer():
await trade.user.send("Thank you for your trade")
print(f"Received trade: #{trade.id}")
print("Trade partner is:", trade.user)
print("We would send:", len(trade.sending), "items")
print("We would receive:", len(trade.receiving), "items")
if trade.is_gift():
print("Accepting the trade as it is a gift")
await trade.accept()
client = MyClient()
client.run("username", "password")
from steam.ext import commands
bot = commands.Bot(command_prefix="!")
@bot.command
async def ping(ctx: commands.Context) -> None:
await ctx.send("Pong!")
bot.run("username", "password")