aboutsummaryrefslogtreecommitdiff
path: root/discord/user.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2021-04-04 04:40:19 -0400
committerRapptz <[email protected]>2021-04-04 07:03:53 -0400
commit9d39b135f4f84239787b0901d06a4f370a82d4bb (patch)
tree8826845cfd47eafa5c9d2ef1fcbedd36382714f4 /discord/user.py
parentBump minimum Python version to 3.8 (diff)
downloaddiscord.py-9d39b135f4f84239787b0901d06a4f370a82d4bb.tar.xz
discord.py-9d39b135f4f84239787b0901d06a4f370a82d4bb.zip
Modernize code to use f-strings
This also removes the encoding on the top, since Python 3 does it by default. It also changes some methods to use `yield from`.
Diffstat (limited to 'discord/user.py')
-rw-r--r--discord/user.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/discord/user.py b/discord/user.py
index 3cddf99c..25377b78 100644
--- a/discord/user.py
+++ b/discord/user.py
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
"""
The MIT License (MIT)
@@ -199,7 +197,7 @@ class BaseUser(_BaseUser):
@property
def default_avatar_url(self):
""":class:`Asset`: Returns a URL for a user's default avatar."""
- return Asset(self._state, '/embed/avatars/{}.png'.format(self.default_avatar.value))
+ return Asset(self._state, f'/embed/avatars/{self.default_avatar.value}.png')
@property
def colour(self):
@@ -222,7 +220,7 @@ class BaseUser(_BaseUser):
@property
def mention(self):
""":class:`str`: Returns a string that allows you to mention the given user."""
- return '<@{0.id}>'.format(self)
+ return f'<@{self.id}>'
def permissions_in(self, channel):
"""An alias for :meth:`abc.GuildChannel.permissions_for`.