mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-08 04:38:42 +00:00
Fix AuditLogDiff.type for integrations
This commit is contained in:
parent
3d2dedbc58
commit
39f1f84718
@ -283,9 +283,11 @@ def _flag_transformer(cls: Type[F]) -> Callable[[AuditLogEntry, Union[int, str]]
|
|||||||
return _transform
|
return _transform
|
||||||
|
|
||||||
|
|
||||||
def _transform_type(entry: AuditLogEntry, data: int) -> Union[enums.ChannelType, enums.StickerType]:
|
def _transform_type(entry: AuditLogEntry, data: Union[int, str]) -> Union[enums.ChannelType, enums.StickerType, str]:
|
||||||
if entry.action.name.startswith('sticker_'):
|
if entry.action.name.startswith('sticker_'):
|
||||||
return enums.try_enum(enums.StickerType, data)
|
return enums.try_enum(enums.StickerType, data)
|
||||||
|
elif entry.action.name.startswith('integration_'):
|
||||||
|
return data # type: ignore # integration type is str
|
||||||
else:
|
else:
|
||||||
return enums.try_enum(enums.ChannelType, data)
|
return enums.try_enum(enums.ChannelType, data)
|
||||||
|
|
||||||
|
@ -3516,9 +3516,9 @@ AuditLogDiff
|
|||||||
|
|
||||||
.. attribute:: type
|
.. attribute:: type
|
||||||
|
|
||||||
The type of channel or sticker.
|
The type of channel, sticker or integration.
|
||||||
|
|
||||||
:type: Union[:class:`ChannelType`, :class:`StickerType`]
|
:type: Union[:class:`ChannelType`, :class:`StickerType`, :class:`str`]
|
||||||
|
|
||||||
.. attribute:: topic
|
.. attribute:: topic
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user