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
  2. Getting Player Details

FCM Listener

PreviousGetting Player DetailsNextGetting Entity ID's

Last updated 8 months ago

Was this helpful?

Should you need to listen for additional messages, like pairing requests, this is built into the library too!

main.py
from rustplus import FCMListener
import json

with open("rustplus.py.config.json", "r") as input_file:
    fcm_details = json.load(input_file)

class FCM(FCMListener):
    
    def on_notification(self, obj, notification, data_message):
        print(notification)
        
FCM(fcm_details).start()

The on_notification method will be called everytime a message is received from the game server.

The rustplus.py.config.json is the file created by the RustCli, when you register for FCM notifications. See:

Getting Player Details