aboutsummaryrefslogtreecommitdiff
path: root/discord/client.py
diff options
context:
space:
mode:
Diffstat (limited to 'discord/client.py')
-rw-r--r--discord/client.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/discord/client.py b/discord/client.py
index 85035535..8ea1cf30 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -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