mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-06 01:46:08 +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)
|
||||
|
||||
@ -103,8 +101,8 @@ class PartialEmoji(_EmojiTag):
|
||||
if self.id is None:
|
||||
return self.name
|
||||
if self.animated:
|
||||
return '<a:%s:%s>' % (self.name, self.id)
|
||||
return '<:%s:%s>' % (self.name, self.id)
|
||||
return f'<a:{self.name}:{self.id}>'
|
||||
return f'<:{self.name}:{self.id}>'
|
||||
|
||||
def __repr__(self):
|
||||
return '<{0.__class__.__name__} animated={0.animated} name={0.name!r} id={0.id}>'.format(self)
|
||||
@ -134,7 +132,7 @@ class PartialEmoji(_EmojiTag):
|
||||
def _as_reaction(self):
|
||||
if self.id is None:
|
||||
return self.name
|
||||
return '%s:%s' % (self.name, self.id)
|
||||
return f'{self.name}:{self.id}'
|
||||
|
||||
@property
|
||||
def created_at(self):
|
||||
|
Reference in New Issue
Block a user