mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-05 17:36:15 +00:00
Fix AuditLogDiff.type for webhooks
This commit is contained in:
@ -283,11 +283,15 @@ def _flag_transformer(cls: Type[F]) -> Callable[[AuditLogEntry, Union[int, str]]
|
||||
return _transform
|
||||
|
||||
|
||||
def _transform_type(entry: AuditLogEntry, data: Union[int, str]) -> Union[enums.ChannelType, enums.StickerType, str]:
|
||||
def _transform_type(
|
||||
entry: AuditLogEntry, data: Union[int, str]
|
||||
) -> Union[enums.ChannelType, enums.StickerType, enums.WebhookType, str]:
|
||||
if entry.action.name.startswith('sticker_'):
|
||||
return enums.try_enum(enums.StickerType, data)
|
||||
elif entry.action.name.startswith('integration_'):
|
||||
return data # type: ignore # integration type is str
|
||||
elif entry.action.name.startswith('webhook_'):
|
||||
return enums.try_enum(enums.WebhookType, data)
|
||||
else:
|
||||
return enums.try_enum(enums.ChannelType, data)
|
||||
|
||||
|
Reference in New Issue
Block a user