Rust+.py Docs
  • Getting Started
    • Welcome to the Rust+.py Docs!
    • Quick Start
    • Getting Player Details
      • FCM Listener
      • Getting Entity ID's
    • RustSocket
      • Rate Limiting
  • API methods
    • Removing Listeners
    • Getting Team Info
    • Getting Team Chat
    • Getting Server Info
    • Getting the Map
    • Sending Messages
    • Getting the Time
    • Getting Entity Information
    • Getting Map Markers
    • Getting Contents of Monitors
    • Promoting Players to Team Leader
  • Command System
    • Commands Overview
    • Command Options
    • Command Decorator
    • Hanging The Socket
  • Event System
    • Events Overview
  • Cameras
    • Camera Managers
Powered by GitBook
On this page

Was this helpful?

  1. Getting Started

Quick Start

PreviousWelcome to the Rust+.py Docs!NextGetting Player Details

Last updated 7 months ago

Was this helpful?

In order to access the API, you must first install the package using pip:

pip install rustplus

You must then get your Personal details using the web tool, as shown here:

main.py
import asyncio
from rustplus import RustSocket, ServerDetails

async def main():
    server_details = ServerDetails("IP", "PORT", STEAMID, PLAYERTOKEN)
    socket = RustSocket(server_details)
    await socket.connect()

    print(f"It is {(await socket.get_time()).time}")

    await socket.disconnect()

asyncio.run(main())

This will run, and print the time on the Rust Server.

API methods will return an instance of RustError if they are not successful. This is to allow for better error handling, and reconnecting to the server. You can detect these by:

main.py

```python time = await socket.get_time() if isinstance(time, RustError): print(f"Error Occurred, Reason: {time.reason}") ```

Getting Player Details