fix conflicts

This commit is contained in:
iDutchy
2021-05-02 21:05:05 -05:00
84 changed files with 2683 additions and 706 deletions

View File

@@ -3,7 +3,7 @@
"""
The MIT License (MIT)
Copyright (c) 2015-2020 Rapptz
Copyright (c) 2015-present Rapptz
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
@@ -576,6 +576,8 @@ class Client:
Keyword argument that specifies if the account logging on is a bot
token or not.
.. deprecated:: 1.7
Raises
------
:exc:`.LoginFailure`
@@ -590,10 +592,13 @@ class Client:
await self.http.static_login(token.strip(), bot=bot)
self._connection.is_bot = bot
@utils.deprecated('Client.close')
async def logout(self):
"""|coro|
Logs out of Discord and closes all connections.
.. deprecated:: 1.7
.. note::
@@ -754,7 +759,7 @@ class Client:
try:
loop.run_until_complete(start(*args, **kwargs))
except KeyboardInterrupt:
loop.run_until_complete(logout())
loop.run_until_complete(close())
# cancel all tasks lingering
finally:
loop.close()
@@ -833,16 +838,14 @@ 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))
@property
def intents(self):
""":class:`Intents`: The intents configured for this connection.
""":class:`~discord.Intents`: The intents configured for this connection.
.. versionadded:: 1.5
"""
@@ -1154,9 +1157,7 @@ class Client:
# Guild stuff
def fetch_guilds(self, *, limit=100, before=None, after=None):
"""|coro|
Retrieves an :class:`.AsyncIterator` that enables receiving your guilds.
"""Retrieves an :class:`.AsyncIterator` that enables receiving your guilds.
.. note::
@@ -1306,15 +1307,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
@@ -1480,7 +1479,7 @@ class Client:
.. note::
This method is an API call. For general usage, consider :meth:`get_user` instead.
This method is an API call. If you have :attr:`Intents.members` and member cache enabled, consider :meth:`get_user` instead.
Parameters
-----------
@@ -1502,11 +1501,14 @@ class Client:
data = await self.http.get_user(user_id)
return User(state=self._connection, data=data)
@utils.deprecated()
async def fetch_user_profile(self, user_id):
"""|coro|
Gets an arbitrary user's profile.
.. deprecated:: 1.7
.. note::
This can only be used by non-bot accounts.