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. Command System

Commands Overview

Commands allow the triggering of custom coroutines when a specific keyword is sent in the team chat. Basic Usage:

main.py
from rustplus import RustSocket, CommandOptions, Command, ServerDetails, Command, ChatCommand

options = CommandOptions(prefix="!") # Use whatever prefix you want here
server_details = ServerDetails("IP", "PORT", STEAMID, PLAYERTOKEN)
socket = RustSocket(server_details, command_options=options)

@Command(server_details)
async def hi(command : ChatCommand): 
    await socket.send_team_message(f"Hi, {command.sender_name}")
PreviousPromoting Players to Team LeaderNextCommand Options

Last updated 8 months ago

Was this helpful?