Add base class. Make to_json available to all of the existing models.

This commit is contained in:
thecosmos
2019-05-22 23:52:17 +05:30
parent ca36e3ce03
commit d975547968
4 changed files with 24 additions and 13 deletions

View File

@@ -0,0 +1,15 @@
from abc import ABC
class DiscordModelsBase(ABC):
def to_json(self):
"""A utility method which returns raw payload object as it was received from discord.
Returns
-------
dict
A dict representing raw payload object received from discord.
"""
return self._payload