-
Notifications
You must be signed in to change notification settings - Fork 1
Relationships
Discord_Relationships_Filter
Discord_Relationships_Count
Discord_Relationships_Get
Discord_Relationships_GetAt
This function performs a query over the relationships of the current user selection only the ones that match the given type.
Discord_Relationships_Filter(type)
Argument | Type | Description |
---|---|---|
type | Discord_RelationshipType |
The type of relationship to filter when performing the query |
N/A
Discord_Relationship_Filter(Discord_RelationshipType_Friend);
count = Discord_Relationships_Count();
for(var a = 0 ; a < count ; a++)
{
var struct = Discord_Relationships_GetAt(a);
type = struct.type;
username = struct.username;
avatar = struct.avatar;
id = struct.id;
bot = struct.bot;
discriminator = struct.discriminator;
//Do something each loop with this information..
}
Get the number of relationships that match your previous query.
Discord_Relationships_Count()
Discord_Relationships_Filter(Discord_Relationship_Filter_Friend);
count = Discord_Relationships_Count();
for(var a = 0 ; a < count ; a++)
{
var struct = Discord_Relationships_GetAt(a);
type = struct.type;
username = struct.username;
avatar = struct.avatar;
id = struct.id;
bot = struct.bot;
discriminator = struct.discriminator;
//Do something each loop with this information..
}
Get the relationship between the current user and a given user by id.
Discord_Relationships_Get(userId)
Argument | Type | Description |
---|---|---|
userId | int64 | User identifier |
Relationship struct
var struct = Discord_Relationships_getAt(userId);
type = struct.type;
username = struct.username;
avatar = struct.avatar;
userId = struct.userId;
bot = struct.bot;
discriminator = struct.discriminator;
Get the relationship at a given index when iterating over a list of relationships.
⚠️ REQUIRES This function requires a previous call the function Discord_Relationships_Filter.
Discord_Relationships_GetAt(index)
Argument | Type | Description |
---|---|---|
indx | int | Index of the relationship |
Relationship
struct
Discord_Relationships_Filter(Discord_RelationshipType_Friend);
count = Discord_Relationship_Count()
for(var a = 0 ; a < count ; a++)
{
var struct = Discord_Relationship_GetAt(a)
type = struct.type
username = struct.username
avatar = struct.avatar
userId = struct.id
bot = struct.bot
discriminator = struct.discriminator
//Do something each loop with this information..
}
The Relationship structure returned by the following functions:
contains information about the user with whom the connected user has a relationship. The structure includes the user's username, avatar, user ID, whether they are a bot or not, and their discriminator.
The "username" field contains the username of the user, which is the name displayed on their profile and in chat messages. The "avatar" field contains the URL of the user's avatar image. The "userId" field contains the unique user ID assigned by Discord. The "bot" field is a boolean value indicating whether the user is a bot account or a human user. The "discriminator" field contains the four-digit number that appears after the username, used to distinguish between users with the same username.
Here is a table summarizing the fields in the "relationship" structure and their meanings:
Field | Type | Description |
---|---|---|
type | Discord_RelationshipType | The username of the user, which is the name displayed on their profile and in chat messages. |
user | [User ](Users#user |
The user the relationship is for. |
presence | Presence |
That user's current presence |
Constant | Value | Description |
---|---|---|
Discord_RelationshipType_None | 0 | User has no intrinsic relationship on Discord. |
Discord_RelationshipType_Friend | 1 | User is a friend of the connected user, and they can see each other's online status, send direct messages, etc. |
Discord_RelationshipType_Blocked | 2 | User is blocked by the connected user and cannot interact with them on Discord. |
Discord_RelationshipType_PendingIncoming | 3 | User has sent a friend request to the connected user, but it has not yet been accepted. |
Discord_RelationshipType_PendingOutgoing | 4 | Connected user has sent a friend request to the other user, but it has not yet been accepted. |
Discord_RelationshipType_Implicit | 5 | Users are not friends but interact with each other often, based on frequency and recency of interactions. |
YoYoGames 2024