Update pyright version

This commit is contained in:
Josh
2023-07-02 08:26:27 +10:00
committed by GitHub
parent 0871b34fc8
commit 630b2a1e55
17 changed files with 45 additions and 27 deletions

View File

@ -132,6 +132,7 @@ if TYPE_CHECKING:
from .types.integration import IntegrationType
from .types.snowflake import SnowflakeList
from .types.widget import EditWidgetSettings
from .types.audit_log import AuditLogEvent
from .message import EmojiInputType
VocalGuildChannel = Union[VoiceChannel, StageChannel]
@ -3853,7 +3854,7 @@ class Guild(Hashable):
async def _before_strategy(retrieve: int, before: Optional[Snowflake], limit: Optional[int]):
before_id = before.id if before else None
data = await self._state.http.get_audit_logs(
self.id, limit=retrieve, user_id=user_id, action_type=action, before=before_id
self.id, limit=retrieve, user_id=user_id, action_type=action_type, before=before_id
)
entries = data.get('audit_log_entries', [])
@ -3869,7 +3870,7 @@ class Guild(Hashable):
async def _after_strategy(retrieve: int, after: Optional[Snowflake], limit: Optional[int]):
after_id = after.id if after else None
data = await self._state.http.get_audit_logs(
self.id, limit=retrieve, user_id=user_id, action_type=action, after=after_id
self.id, limit=retrieve, user_id=user_id, action_type=action_type, after=after_id
)
entries = data.get('audit_log_entries', [])
@ -3887,8 +3888,10 @@ class Guild(Hashable):
else:
user_id = None
if action:
action = action.value
if action is not MISSING:
action_type: Optional[AuditLogEvent] = action.value
else:
action_type = None
if isinstance(before, datetime.datetime):
before = Object(id=utils.time_snowflake(before, high=False))