mirror of
https://github.com/stoatchat/javascript-client-sdk.git
synced 2026-07-19 17:13:31 -04:00
refactor: add toString for User, Emoji, Server, Member
This commit is contained in:
@@ -19,6 +19,14 @@ export class Emoji {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert to string
|
||||
* @returns String
|
||||
*/
|
||||
toString() {
|
||||
return `:${this.id}:`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time when this emoji was created
|
||||
*/
|
||||
|
||||
@@ -24,6 +24,14 @@ export class Server {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert to string
|
||||
* @returns String
|
||||
*/
|
||||
toString() {
|
||||
return `<%${this.id}>`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time when this server was created
|
||||
*/
|
||||
|
||||
@@ -33,6 +33,14 @@ export class ServerMember {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert to string
|
||||
* @returns String
|
||||
*/
|
||||
toString() {
|
||||
return `<@${this.id.user}>`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Server this member belongs to
|
||||
*/
|
||||
|
||||
@@ -20,6 +20,14 @@ export class User {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert to string
|
||||
* @returns String
|
||||
*/
|
||||
toString() {
|
||||
return `<@${this.id}>`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time when this user created their account
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user