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`.
This commit is contained in:
Rapptz
2021-04-04 04:40:19 -04:00
parent 9fc2ab9c99
commit 9d39b135f4
67 changed files with 262 additions and 378 deletions

View File

@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-
"""
The MIT License (MIT)
@ -77,7 +75,7 @@ class WidgetChannel:
@property
def mention(self):
""":class:`str`: The string that allows you to mention the channel."""
return '<#%s>' % self.id
return f'<#{self.id}>'
@property
def created_at(self):
@ -236,7 +234,7 @@ class Widget:
@property
def json_url(self):
""":class:`str`: The JSON URL of the widget."""
return "https://discord.com/api/guilds/{0.id}/widget.json".format(self)
return f"https://discord.com/api/guilds/{self.id}/widget.json"
@property
def invite_url(self):