Code optimisations and refactoring via Sourcery
This commit is contained in:
@ -754,9 +754,7 @@ class Client:
|
||||
|
||||
@allowed_mentions.setter
|
||||
def allowed_mentions(self, value):
|
||||
if value is None:
|
||||
self._connection.allowed_mentions = value
|
||||
elif isinstance(value, AllowedMentions):
|
||||
if value is None or isinstance(value, AllowedMentions):
|
||||
self._connection.allowed_mentions = value
|
||||
else:
|
||||
raise TypeError('allowed_mentions must be AllowedMentions not {0.__class__!r}'.format(value))
|
||||
@ -1227,15 +1225,13 @@ class Client:
|
||||
if icon is not None:
|
||||
icon = utils._bytes_to_base64_data(icon)
|
||||
|
||||
if region is None:
|
||||
region = VoiceRegion.us_west.value
|
||||
else:
|
||||
region = region.value
|
||||
region = region or VoiceRegion.us_west
|
||||
region_value = region.value
|
||||
|
||||
if code:
|
||||
data = await self.http.create_from_template(code, name, region, icon)
|
||||
data = await self.http.create_from_template(code, name, region_value, icon)
|
||||
else:
|
||||
data = await self.http.create_guild(name, region, icon)
|
||||
data = await self.http.create_guild(name, region_value, icon)
|
||||
return Guild(data=data, state=self._connection)
|
||||
|
||||
# Invite management
|
||||
|
Reference in New Issue
Block a user