Closed FeelsBadMan1 closed 3 years ago
same error
AttributeError: 'NoneType' object has no attribute 'from_json'```
I have a fix. Just gimmie a moment and I'll set up a PR
Nvm. I guess i was a little to quick to read this issue, my PR fixes the error that @helish88 gets.
But I think your error stems from using discord-buttons
and not the updated discord-components
@FeelsBadMan1
Nvm. I guess i was a little to quick to read this issue, my PR fixes the error that @helish88 gets. But I think your error stems from using
discord-buttons
and not the updateddiscord-components
@FeelsBadMan1
Okey it is good that you solved to error from the other one that had almost the same. I defently tried both modules buttons aswell as components. while using the components i get this errorlog:
Ignoring exception in on_message
Traceback (most recent call last):
File "D:\Downloads\Python\python 3.8.7\lib\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "D:/my_python_projects/MongoDB Test/mongosetup.py", line 31, in on_message
await msg.channel.send(
File "D:\Downloads\Python\python 3.8.7\lib\site-packages\discord_components\client.py", line 58, in send_component_msg_prop
return await self.send_component_msg(ctxorchannel, *args, **kwargs)
File "D:\Downloads\Python\python 3.8.7\lib\site-packages\discord_components\client.py", line 152, in send_component_msg
data = await self.bot.http.request(
File "D:\Downloads\Python\python 3.8.7\lib\site-packages\discord\http.py", line 156, in request
kwargs['data'] = utils.to_json(kwargs.pop('json'))
File "D:\Downloads\Python\python 3.8.7\lib\site-packages\discord\utils.py", line 328, in to_json
return json.dumps(obj, separators=(',', ':'), ensure_ascii=True)
File "D:\Downloads\Python\python 3.8.7\lib\json\__init__.py", line 234, in dumps
return cls(
File "D:\Downloads\Python\python 3.8.7\lib\json\encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "D:\Downloads\Python\python 3.8.7\lib\json\encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "D:\Downloads\Python\python 3.8.7\lib\json\encoder.py", line 179, in default
raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type Button is not JSON serializable
Hey. today discord released the buttons but somehow i find 2 codeexamples in the docs one use buttons and one use components. if i use the components exaple i get a json not seziable error and if i use buttons i get this:
anyone knows a solution?