mirror of
https://github.com/yawaflua/Flask-Discord.git
synced 2026-02-04 10:14:15 +02:00
Add base class. Make to_json available to all of the existing models.
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
from .base import DiscordModelsBase
|
||||
|
||||
from .. import configs
|
||||
|
||||
|
||||
class User(object):
|
||||
class User(DiscordModelsBase):
|
||||
"""Class representing Discord User.
|
||||
|
||||
Attributes
|
||||
@@ -65,16 +67,6 @@ class User(object):
|
||||
"""A boolean representing if avatar of user is animated. Meaning user has GIF avatar."""
|
||||
return self.avatar_hash.startswith("a_")
|
||||
|
||||
def to_json(self):
|
||||
"""A utility method which returns raw user object as it was returned from discord.
|
||||
|
||||
Returns
|
||||
-------
|
||||
dict
|
||||
A dict of user's document.
|
||||
"""
|
||||
return self._payload
|
||||
|
||||
|
||||
class Bot(User):
|
||||
"""Class representing the client user itself.
|
||||
|
||||
Reference in New Issue
Block a user