mirror of
https://github.com/Rapptz/discord.py.git
synced 2026-11-20 13:29:03 +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 parent
9fc2ab9c99
commit
9d39b135f4
67 files changed
+262
-378
No files matched your search
+2
-4
@@ -1,5 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
The MIT License (MIT)
|
||||
|
||||
@@ -149,7 +147,7 @@ class ConnectionState:
|
||||
intents = options.get('intents', None)
|
||||
if intents is not None:
|
||||
if not isinstance(intents, Intents):
|
||||
raise TypeError('intents parameter must be Intent not %r' % type(intents))
|
||||
raise TypeError(f'intents parameter must be Intent not {type(intents)!r}')
|
||||
else:
|
||||
intents = Intents.default()
|
||||
|
||||
@@ -175,7 +173,7 @@ class ConnectionState:
|
||||
cache_flags = MemberCacheFlags.from_intents(intents)
|
||||
else:
|
||||
if not isinstance(cache_flags, MemberCacheFlags):
|
||||
raise TypeError('member_cache_flags parameter must be MemberCacheFlags not %r' % type(cache_flags))
|
||||
raise TypeError(f'member_cache_flags parameter must be MemberCacheFlags not {type(cache_flags)!r}')
|
||||
|
||||
cache_flags._verify_intents(intents)
|
||||
|
||||
|
||||
Reference in new issue
Block a user