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}")

Last updated