diff options
| author | Rapptz <[email protected]> | 2017-07-31 21:30:35 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2017-07-31 21:32:12 -0400 |
| commit | 3dc11956376a6be9db280d09e318a7c2749a0961 (patch) | |
| tree | d8441a3dfaca64c69caace5768f9d9ff766cb353 | |
| parent | Fix AsyncIterator documentation to properly show coroutines. (diff) | |
| download | discord.py-3dc11956376a6be9db280d09e318a7c2749a0961.tar.xz discord.py-3dc11956376a6be9db280d09e318a7c2749a0961.zip | |
Remove Guild.default_channel
The concept no longer exists.
| -rw-r--r-- | discord/guild.py | 14 | ||||
| -rw-r--r-- | docs/migrating.rst | 5 |
2 files changed, 12 insertions, 7 deletions
diff --git a/discord/guild.py b/discord/guild.py index 34eed175..53cc728a 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -323,11 +323,6 @@ class Guild(Hashable): return utils.find(lambda r: r.is_default(), self.roles) @property - def default_channel(self): - """Gets the default :class:`TextChannel` for the guild.""" - return self.get_channel(self.id) - - @property def owner(self): """:class:`Member`: The member that owns the guild.""" return self.get_member(self.owner_id) @@ -1100,8 +1095,13 @@ class Guild(Hashable): # we start with { code: abc } payload = yield from self._state.http.get_vanity_code(self.id) + + # get the vanity URL channel since default channels aren't + # reliable or a thing anymore + data = yield from self._state.http.get_invite(payload['code']) + payload['guild'] = self - payload['channel'] = self.default_channel + payload['channel'] = self.get_channel(int(data['channel']['id'])) payload['revoked'] = False payload['temporary'] = False payload['max_uses'] = 0 @@ -1181,7 +1181,7 @@ class Guild(Hashable): Getting entries made by a specific user: :: entries = await guild.audit_logs(limit=None, user=guild.me).flatten() - await guild.default_channel.send('I made {} moderation actions.'.format(len(entries))) + await channel.send('I made {} moderation actions.'.format(len(entries))) """ if user: user = user.id diff --git a/docs/migrating.rst b/docs/migrating.rst index 9536bbd4..74d969ae 100644 --- a/docs/migrating.rst +++ b/docs/migrating.rst @@ -337,6 +337,11 @@ They will be enumerated here. - There is no replacement for this one. This functionality is deprecated API wise. +- ``Guild.default_channel`` / ``Server.default_channel`` + + - The concept of a default channel was removed from Discord. + See `#329 <https://github.com/hammerandchisel/discord-api-docs/pull/329>`_. + - ``Message.edited_timestamp`` - Use :attr:`Message.edited_at` instead. |