-
Notifications
You must be signed in to change notification settings - Fork 1
Relationships
YYBartT edited this page Mar 23, 2023
·
7 revisions
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..
}
YoYoGames 2024