Skip to content

Relationship Manager

Variables

relationship

Type: Dictionary

KeyTypeDescription
"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"Dictionaryuser
"presence"DictionaryWill be described below.

presence

Type: Dictionary

NameTypeDescription
"status"String
The user status:"Offline"
"Online"
"Idle"
"DoNotDisturb"
"NotAvailable"
"activity"DictionaryAll activity values and the "name" of the activity

Signals

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

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

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

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