refactor: add toString for User, Emoji, Server, Member

This commit is contained in:
Paul Makles
2023-04-09 15:05:00 +01:00
parent 17ee78f00e
commit 6404c83ff0
4 changed files with 32 additions and 0 deletions
+8
View File
@@ -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
*/
+8
View File
@@ -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
*/
+8
View File
@@ -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
*/
+8
View File
@@ -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
*/