aboutsummaryrefslogtreecommitdiff
path: root/discord/channel.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2021-04-04 10:09:25 -0400
committerRapptz <[email protected]>2021-04-04 10:15:30 -0400
commit54288879e28cc63eefce33311ec393a4eed476c4 (patch)
tree5bada5e0d4f1c997773d7216d14b3338ac76f1fa /discord/channel.py
parentRemove asyncio.Task subclass in preference to task names (diff)
downloaddiscord.py-54288879e28cc63eefce33311ec393a4eed476c4.tar.xz
discord.py-54288879e28cc63eefce33311ec393a4eed476c4.zip
Remove userbot functionality
This has a lot of legacy and cruft so there may be some stuff I've missed but this first pass is enough to get a clear separation.
Diffstat (limited to 'discord/channel.py')
-rw-r--r--discord/channel.py98
1 files changed, 2 insertions, 96 deletions
diff --git a/discord/channel.py b/discord/channel.py
index 00f77db0..5c6eed1e 100644
--- a/discord/channel.py
+++ b/discord/channel.py
@@ -311,10 +311,6 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
account). The :attr:`~Permissions.read_message_history` permission is
also needed to retrieve message history.
- Internally, this employs a different number of strategies depending
- on the conditions met such as if a bulk delete is possible or if
- the account is a user bot or not.
-
Examples
---------
@@ -345,8 +341,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
bulk: :class:`bool`
If ``True``, use bulk delete. Setting this to ``False`` is useful for mass-deleting
a bot's own messages without :attr:`Permissions.manage_messages`. When ``True``, will
- fall back to single delete if current account is a user bot (now deprecated), or if messages are
- older than two weeks.
+ fall back to single delete if messages are older than two weeks.
Raises
-------
@@ -369,7 +364,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
count = 0
minimum_time = int((time.time() - 14 * 24 * 60 * 60) * 1000.0 - 1420070400000) << 22
- strategy = self.delete_messages if self._state.is_bot and bulk else _single_delete_strategy
+ strategy = self.delete_messages if bulk else _single_delete_strategy
while True:
try:
@@ -1442,95 +1437,6 @@ class GroupChannel(discord.abc.Messageable, Hashable):
return base
- @utils.deprecated()
- async def add_recipients(self, *recipients):
- r"""|coro|
-
- Adds recipients to this group.
-
- A group can only have a maximum of 10 members.
- Attempting to add more ends up in an exception. To
- add a recipient to the group, you must have a relationship
- with the user of type :attr:`RelationshipType.friend`.
-
- .. deprecated:: 1.7
-
- Parameters
- -----------
- \*recipients: :class:`User`
- An argument list of users to add to this group.
-
- Raises
- -------
- HTTPException
- Adding a recipient to this group failed.
- """
-
- # TODO: wait for the corresponding WS event
-
- req = self._state.http.add_group_recipient
- for recipient in recipients:
- await req(self.id, recipient.id)
-
- @utils.deprecated()
- async def remove_recipients(self, *recipients):
- r"""|coro|
-
- Removes recipients from this group.
-
- .. deprecated:: 1.7
-
- Parameters
- -----------
- \*recipients: :class:`User`
- An argument list of users to remove from this group.
-
- Raises
- -------
- HTTPException
- Removing a recipient from this group failed.
- """
-
- # TODO: wait for the corresponding WS event
-
- req = self._state.http.remove_group_recipient
- for recipient in recipients:
- await req(self.id, recipient.id)
-
- @utils.deprecated()
- async def edit(self, **fields):
- """|coro|
-
- Edits the group.
-
- .. deprecated:: 1.7
-
- Parameters
- -----------
- name: Optional[:class:`str`]
- The new name to change the group to.
- Could be ``None`` to remove the name.
- icon: Optional[:class:`bytes`]
- A :term:`py:bytes-like object` representing the new icon.
- Could be ``None`` to remove the icon.
-
- Raises
- -------
- HTTPException
- Editing the group failed.
- """
-
- try:
- icon_bytes = fields['icon']
- except KeyError:
- pass
- else:
- if icon_bytes is not None:
- fields['icon'] = utils._bytes_to_base64_data(icon_bytes)
-
- data = await self._state.http.edit_group(self.id, **fields)
- self._update_group(data)
-
async def leave(self):
"""|coro|