phenom4n4n / phen-cogs

My public cogs for Red, Discord bot.
https://phen-cogs.readthedocs.io/en/latest/
MIT License
120 stars 71 forks source link

[ReactRole] Error in reactrole bind #33

Closed Zenchaeus closed 3 years ago

Zenchaeus commented 3 years ago

i tried to use the reactrole bind but somehow it doesn't work. i provided the error below.

Exception in command 'reactrole bind' Traceback (most recent call last): File "/home/mkurisu069/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped ret = await coro(*args, **kwargs) File "/home/mkurisu069/.local/share/Red-DiscordBot/data/Redbot/cogs/CogManager/cogs/roleutils/reactroles.py", line 163, in reactrole_add r["rules"] = rules File "/home/mkurisu069/redenv/lib/python3.8/site-packages/redbot/core/config.py", line 115, in aexit await self.value_obj.set(self.raw_value) File "/home/mkurisu069/redenv/lib/python3.8/site-packages/redbot/core/config.py", line 561, in set await super().set(value) File "/home/mkurisu069/redenv/lib/python3.8/site-packages/redbot/core/config.py", line 257, in set await self.driver.set(self.identifier_data, value=value) File "/home/mkurisu069/redenv/lib/python3.8/site-packages/redbot/core/drivers/json.py", line 146, in set value_copy = json.loads(json.dumps(value)) File "/usr/lib/python3.8/json/init.py", line 231, in dumps return _default_encoder.encode(obj) File "/usr/lib/python3.8/json/encoder.py", line 199, in encode chunks = self.iterencode(o, _one_shot=True) File "/usr/lib/python3.8/json/encoder.py", line 257, in iterencode return _iterencode(o, 0) File "/usr/lib/python3.8/json/encoder.py", line 179, in default raise TypeError(f'Object of type {o.class.name} ' TypeError: Object of type ReactRules is not JSON serializable

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/home/mkurisu069/redenv/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 902, in invoke await ctx.command.invoke(ctx) File "/home/mkurisu069/redenv/lib/python3.8/site-packages/redbot/core/commands/commands.py", line 832, in invoke await super().invoke(ctx) File "/home/mkurisu069/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 1340, in invoke await ctx.invoked_subcommand.invoke(ctx) File "/home/mkurisu069/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 864, in invoke await injected(*ctx.args, **ctx.kwargs) File "/home/mkurisu069/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped raise CommandInvokeError(exc) from exc discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: Object of type ReactRules is not JSON serializable

phenom4n4n commented 3 years ago

Thanks for reporting this bug, it's been fixed in the latest commit.