Cast activity enumerator to integer instead of accessing value directly
Should make the library more resilient to future changes.
This commit is contained in:
		| @@ -175,7 +175,7 @@ class Activity(_ActivityTag): | |||||||
|                 continue |                 continue | ||||||
|  |  | ||||||
|             ret[attr] = value |             ret[attr] = value | ||||||
|         ret['type'] = self.type.value |         ret['type'] = int(self.type) | ||||||
|         return ret |         return ret | ||||||
|  |  | ||||||
|     @property |     @property | ||||||
|   | |||||||
| @@ -380,6 +380,9 @@ class ActivityType(Enum): | |||||||
|     listening = 2 |     listening = 2 | ||||||
|     watching = 3 |     watching = 3 | ||||||
|  |  | ||||||
|  |     def __int__(self): | ||||||
|  |         return self.value | ||||||
|  |  | ||||||
| class HypeSquadHouse(Enum): | class HypeSquadHouse(Enum): | ||||||
|     bravery = 1 |     bravery = 1 | ||||||
|     brilliance = 2 |     brilliance = 2 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user