Relationship Manager
Variables
Section titled “Variables”relationship
Section titled “relationship”Type: Dictionary
Key | Type | Description |
---|---|---|
"type" | String | The type of relationship the current user has with the given user. These are:"None" user has no intrinsic relationship"Friend" user is a friend"Blocked" user is blocked"PendingIncoming" user has a pending incoming friend request to connected user"PendingOutgoing" current user has a pending outgoing friend request to user"Implicit" user is not friends, but interacts with current user often (frequency + recency)"NotAvailable" relationship is unknown |
"user" | Dictionary | user |
"presence" | Dictionary | Will be described below. |
presence
Section titled “presence”Type: Dictionary
Name | Type | Description |
---|---|---|
"status" | String | The user status:"Offline" "Online" "Idle" "DoNotDisturb" "NotAvailable" |
"activity" | Dictionary | All activity values and the "name" of the activity |
Signals
Section titled “Signals”Relationship init
Section titled “Relationship init”Connect it with:
DiscordRPC.connect("relationships_init",_on_relationships_init)
Add it in your gdscript as function:
func _on_relationships_init():
The Signal fires when Discord is ready to offer relationship information.
Updated relationship
Section titled “Updated relationship”Connect it with:
DiscordRPC.connect("updated_relationship",_on_updated_relationship)
Add it in your gdscript as function:
func _on_updated_relationship(relationship):
The Signal fires when a user in the Relationships list of the current user updated any user information.
For example activity details update, avatar update, username update, online, offline etc…
Given variable: Dictionary relationship
Methods
Section titled “Methods”Get relationship
Section titled “Get relationship”Returns the relationship between the current user and the user_id
DiscordRPC.get_relationship(user_id)
Taken variable: int user_id
Given variable: Dictionary relationship
Get all relationships
Section titled “Get all relationships”Returns all relationships the current user has. Warning: this will be many! (if not I’m sorry xD)
DiscordRPC.get_all_relationships()
Given variable: Dictionary relationship