mirror of
https://github.com/stoatchat/javascript-client-sdk.git
synced 2026-07-18 00:16:14 -04:00
chore: role icon property
This commit is contained in:
@@ -271,6 +271,13 @@ export class Message {
|
||||
return this.masquerade?.colour ?? this.member?.roleColour;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the role colour for this message
|
||||
*/
|
||||
get roleIcon(): File | null | undefined {
|
||||
return this.member?.roleIcon;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the avatar URL for this message
|
||||
*/
|
||||
|
||||
@@ -156,6 +156,18 @@ export class ServerMember {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Member's current role icon.
|
||||
*/
|
||||
get roleIcon(): File | null | undefined {
|
||||
const roles = this.orderedRoles.filter((x) => x.colour);
|
||||
if (roles.length > 0) {
|
||||
return roles[roles.length - 1].icon;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Member's ranking
|
||||
* Smaller values are ranked as higher priority
|
||||
|
||||
Reference in New Issue
Block a user