Fix error when creating guild channels.

This commit is contained in:
Rapptz 2017-09-13 18:47:40 -04:00
parent e614f6b4cd
commit 7b2e06c263

View File

@ -520,7 +520,7 @@ class Guild(Hashable):
return utils.find(pred, members) return utils.find(pred, members)
def _create_channel(self, name, overwrites, type, reason): def _create_channel(self, name, overwrites, channel_type, reason):
if overwrites is None: if overwrites is None:
overwrites = {} overwrites = {}
elif not isinstance(overwrites, dict): elif not isinstance(overwrites, dict):
@ -545,7 +545,7 @@ class Guild(Hashable):
perms.append(payload) perms.append(payload)
return self._state.http.create_channel(self.id, name, str(type), permission_overwrites=perms, reason=reason) return self._state.http.create_channel(self.id, name, channel_type.value, permission_overwrites=perms, reason=reason)
@asyncio.coroutine @asyncio.coroutine
def create_text_channel(self, name, *, overwrites=None, reason=None): def create_text_channel(self, name, *, overwrites=None, reason=None):