mirror of
https://github.com/yawaflua/Flask-Discord.git
synced 2025-12-10 04:19:31 +02:00
Add base class. Make to_json available to all of the existing models.
This commit is contained in:
15
flask_discord/models/base.py
Normal file
15
flask_discord/models/base.py
Normal 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
|
||||
Reference in New Issue
Block a user