pycord icon indicating copy to clipboard operation
pycord copied to clipboard

on_auto_moderation_rule_X events TypeError

Open Quintenvw opened this issue 3 years ago • 3 comments

Summary

on_auto_moderation_rule_X events throw TypeErrors

Reproduction Steps

Try to use the events.

Minimal Reproducible Code

@commands.Cog.listener()
async def on_auto_moderation_rule_create(self, rule):
    print(rule.guild.id)

Expected Results

A usable guild object.

Actual Results

TypeError: No 'dict' attribute on 'AutoModRule' instance to cache 'guild' property

Intents

auto_moderation_configuration, guilds, etc.

System Information

Python v3.10.6-final py-cord v2.4.None-final aiohttp v3.8.3 Linux 5.15.0-67-generic #74-Ubuntu

Checklist

  • [X] I have searched the open issues for duplicates.
  • [X] I have shown the entire traceback, if possible.
  • [X] I have removed my token from display, if visible.

Additional Context

No response

Quintenvw avatar Mar 17 '23 11:03 Quintenvw

Please show the full traceback

plun1331 avatar Mar 17 '23 13:03 plun1331

image

Quintenvw avatar Mar 17 '23 14:03 Quintenvw

This may be of help? https://github.com/Pycord-Development/pycord/blob/f8b4294ff06e0f700bcfe8c0ec13d0ec0085c7dd/discord/automod.py#L402-L405

UP929312 avatar Mar 21 '23 09:03 UP929312