looks like I changed stuff?

This commit is contained in:
iDutchy
2021-06-25 20:29:27 -05:00
78 changed files with 2136 additions and 2539 deletions

View File

@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-
"""
The MIT License (MIT)
@@ -46,6 +44,9 @@ from .asset import Asset
from .flags import SystemChannelFlags
from .integrations import Integration
__all__ = (
'Guild',
)
BanEntry = namedtuple('BanEntry', 'reason user')
_GuildLimit = namedtuple('_GuildLimit', 'emoji bitrate filesize')
@@ -212,11 +213,14 @@ class Guild(Hashable):
def __repr__(self):
attrs = (
'id', 'name', 'shard_id', 'chunked'
('id', self.id),
('name', self.name),
('shard_id', self.shard_id),
('chunked', self.chunked),
('member_count', getattr(self, '_member_count', None)),
)
resolved = ['%s=%r' % (attr, getattr(self, attr)) for attr in attrs]
resolved.append('member_count=%r' % getattr(self, '_member_count', None))
return '<Guild %s>' % ' '.join(resolved)
inner = ' '.join('%s=%r' % t for t in attrs)
return f'<Guild {inner}>'
def _update_voice_state(self, data, channel_id):
user_id = int(data['user_id'])
@@ -1352,7 +1356,8 @@ class Guild(Hashable):
Pass ``None`` to fetch all members. Note that this is potentially slow.
after: Optional[Union[:class:`.abc.Snowflake`, :class:`datetime.datetime`]]
Retrieve members after this date or object.
If a date is provided it must be a timezone-naive datetime representing UTC time.
If a datetime is provided, it is recommended to use a UTC aware datetime.
If the datetime is naive, it is assumed to be local time.
Raises
------
@@ -1560,7 +1565,7 @@ class Guild(Hashable):
"""
if not isinstance(days, int):
raise InvalidArgument('Expected int for ``days``, received {0.__class__.__name__} instead.'.format(days))
raise InvalidArgument(f'Expected int for ``days``, received {days.__class__.__name__} instead.')
if roles:
roles = [str(role.id) for role in roles]
@@ -1646,7 +1651,7 @@ class Guild(Hashable):
"""
if not isinstance(days, int):
raise InvalidArgument('Expected int for ``days``, received {0.__class__.__name__} instead.'.format(days))
raise InvalidArgument(f'Expected int for ``days``, received {days.__class__.__name__} instead.')
if roles:
roles = [str(role.id) for role in roles]
@@ -1949,7 +1954,7 @@ class Guild(Hashable):
valid_keys = ('name', 'permissions', 'color', 'hoist', 'mentionable')
for key in fields:
if key not in valid_keys:
raise InvalidArgument('%r is not a valid field.' % key)
raise InvalidArgument(f'{key!r} is not a valid field.')
data = await self._state.http.create_role(self.id, reason=reason, **fields)
role = Role(guild=self, data=data, state=self._state)
@@ -2142,29 +2147,6 @@ class Guild(Hashable):
payload['max_age'] = 0
return Invite(state=self._state, data=payload)
@utils.deprecated()
def ack(self):
"""|coro|
Marks every message in this guild as read.
The user must not be a bot user.
.. deprecated:: 1.7
Raises
-------
HTTPException
Acking failed.
ClientException
You must not be a bot user.
"""
state = self._state
if state.is_bot:
raise ClientException('Must not be a bot account to ack messages.')
return state.http.ack_guild(self.id)
def audit_logs(self, *, limit=100, before=None, after=None, oldest_first=None, user=None, action=None):
"""Returns an :class:`AsyncIterator` that enables receiving the guild's audit logs.
@@ -2194,10 +2176,12 @@ class Guild(Hashable):
The number of entries to retrieve. If ``None`` retrieve all entries.
before: Union[:class:`abc.Snowflake`, :class:`datetime.datetime`]
Retrieve entries before this date or entry.
If a date is provided it must be a timezone-naive datetime representing UTC time.
If a datetime is provided, it is recommended to use a UTC aware datetime.
If the datetime is naive, it is assumed to be local time.
after: Union[:class:`abc.Snowflake`, :class:`datetime.datetime`]
Retrieve entries after this date or entry.
If a date is provided it must be a timezone-naive datetime representing UTC time.
If a datetime is provided, it is recommended to use a UTC aware datetime.
If the datetime is naive, it is assumed to be local time.
oldest_first: :class:`bool`
If set to ``True``, return entries in oldest->newest order. Defaults to ``True`` if
``after`` is specified, otherwise ``False``.