Skip to content

Relationships

YYBartT edited this page Mar 23, 2023 · 7 revisions

Relationships Functions

Back To Top

Discord_Relationships_Filter

This function performs a query over the relationships of the current user selection only the ones that match the given type.

Syntax

Discord_Relationships_Filter(type)
Argument Type Description
type Discord_RelationshipType The type of relationship to filter when performing the query

Returns

N/A

Example

Discord_Relationship_Filter(Discord_RelationshipType_Friend);
count = Discord_Relationships_Count();
for(var a = 0 ; a < count ; a++)
{
    var structDiscord_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..
}



Back To Top

Discord_Relationships_Count

Get the number of relationships that match your previous query.

Syntax

Discord_Relationships_Count()

Returns

real

Example

Discord_Relationships_Filter(Discord_Relationship_Filter_Friend);
count = Discord_Relationships_Count();
for(var a = 0 ; a < count ; a++)
{
    var structDiscord_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..
}



Back To Top

Discord_Relationships_Get

Get the relationship between the current user and a given user by id.

Syntax

Discord_Relationships_Get(userId)
Argument Type Description
userId int64 User identifier

Returns

Relationship struct

Example

var struct = Discord_Relationships_getAt(userId);
type = struct.type;
username = struct.username;
avatar = struct.avatar;
userId = struct.userId;
bot = struct.bot;
discriminator = struct.discriminator;



Back To Top

Discord_Relationships_GetAt

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.

Syntax

Discord_Relationships_GetAt(index)
Argument Type Description
indx int Index of the relationship

Returns

Relationship struct

Example

Discord_Relationships_Filter(Discord_RelationshipType_Friend);
count = Discord_Relationship_Count()
for(var a = 0 ; a < count ; a++)
{
    var structDiscord_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..
}



Clone this wiki locally