Publicly expose a type property for all channels.

Fix #2185
This commit is contained in:
Rapptz
2019-06-09 00:23:22 -04:00
parent 991140eebe
commit 7e2da1c93b
3 changed files with 22 additions and 12 deletions

View File

@ -611,7 +611,7 @@ class GuildChannel:
base_attrs['name'] = name or self.name
guild_id = self.guild.id
cls = self.__class__
data = await self._state.http.create_channel(guild_id, self._type, reason=reason, **base_attrs)
data = await self._state.http.create_channel(guild_id, self.type.value, reason=reason, **base_attrs)
obj = cls(state=self._state, guild=self.guild, data=data)
# temporarily add it to the cache