Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: AutoMod rule fails to create #75

Open
The-LukeZ opened this issue Feb 19, 2024 · 0 comments · Fixed by #76 or #77
Open

[Bug]: AutoMod rule fails to create #75

The-LukeZ opened this issue Feb 19, 2024 · 0 comments · Fixed by #76 or #77
Assignees
Labels
bug Something isn't working

Comments

@The-LukeZ
Copy link

Description

When trying to create a new automod rule, there are three points at which this can fail.
When using AutoModEventType in event_type instead of int, when using AutoModTriggerType in trigger_type instead of int and always when trying to assign an AutoModAction.
It looks like the type is incorrect every time in the to_dict method.

Branch used

developer

The Python version you are using.

Python v3.11.5-final

What version (and release) of the library are you using

v2.0a643+g33f5246

System info

Windows 11 10.0.22631

Full Traceback (Error)

Ignoring exception in CHAT_INPUT command "config antiraid block-messages" (1208889691063984168)
Traceback (most recent call last):
  File "c:\Users\Lukeh\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\application_commands.py", line 1083, in invoke
    await self.func(self.cog, *args, **kwargs)
  File "C:\Users\Lukeh\Documents\_7-EasySecurity\ext\Commands\config_cmds.py", line 358, in config_antiraid
    rule = await ctx.guild.create_automod_rule(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\Lukeh\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\guild.py", line 3699, in create_automod_rule
    'actions': [a.to_dict() for a in actions],
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\Lukeh\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\guild.py", line 3699, in <listcomp>
    'actions': [a.to_dict() for a in actions],
                ^^^^^^^^^^^
  File "c:\Users\Lukeh\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\automod.py", line 168, in to_dict
    'type': int(self.type)
            ^^^^^^^^^^^^^^
TypeError: int() argument must be a string, a bytes-like object or a real number, not '_EnumValue_AutoModActionType'

Contact info

@TheLukeZ (Discord)

@The-LukeZ The-LukeZ added the bug Something isn't working label Feb 19, 2024
This was linked to pull requests Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants