feat(*): use enums for consistency and speed (#5843)

Co-authored-by: Antonio Román <kyradiscord@gmail.com>
This commit is contained in:
Shubham Parihar
2021-06-15 17:03:31 +05:30
committed by GitHub
parent 671436cbb8
commit f7eeccba4b
9 changed files with 100 additions and 69 deletions

View File

@@ -169,7 +169,7 @@ class Activity {
* The type of the activity status
* @type {ActivityType}
*/
this.type = ActivityTypes[data.type] || ActivityTypes[ActivityTypes.indexOf(data.type)];
this.type = typeof data.type === 'number' ? ActivityTypes[data.type] : data.type;
/**
* If the activity is being streamed, a link to the stream