mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-04 08:56:19 +00:00
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:
@ -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):
|
||||
|
Reference in New Issue
Block a user