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'
Description
When trying to create a new automod rule, there are three points at which this can fail. When using
AutoModEventType
inevent_type
instead ofint
, when usingAutoModTriggerType
intrigger_type
instead ofint
and always when trying to assign anAutoModAction
. It looks like the type is incorrect every time in theto_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)
Contact info
@thelukez (Discord)