diff options
| author | Rapptz <[email protected]> | 2016-03-25 18:30:42 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2016-03-25 18:30:42 -0400 |
| commit | 2ef38107d8f8bd035bd39097a3a74275cef16dd5 (patch) | |
| tree | 4076632b6cf5e77c8c2729d3309b38e6b6c5f102 /discord/role.py | |
| parent | [commands] Add bot decorators into __all__. (diff) | |
| download | discord.py-2ef38107d8f8bd035bd39097a3a74275cef16dd5.tar.xz discord.py-2ef38107d8f8bd035bd39097a3a74275cef16dd5.zip | |
Add missing created_at properties for other objects.
Such as Channel, PrivateChannel, Object and Role.
Diffstat (limited to 'discord/role.py')
| -rw-r--r-- | discord/role.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/discord/role.py b/discord/role.py index adc8c136..dc0acdd6 100644 --- a/discord/role.py +++ b/discord/role.py @@ -27,6 +27,7 @@ DEALINGS IN THE SOFTWARE. from .permissions import Permissions from .colour import Colour from .mixins import Hashable +from .utils import snowflake_time class Role(Hashable): """Represents a Discord role in a :class:`Server`. @@ -90,3 +91,8 @@ class Role(Hashable): def is_everyone(self): """Checks if the role is the @everyone role.""" return self._is_everyone + + @property + def created_at(self): + """Returns the role's creation time in UTC.""" + return utils.snowflake_time(self.id) |