TypeError: 'NoneType' object is not subscriptable | Discord.py
DwellerIgor (1)

file currency.py line 58. I'm making a currency system and bot is supposed to add credits when someone sends a message, but he doesn't do that and I get the error.
Error: Ignoring exception in on_ready Traceback (most recent call last): File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event await coro(*args, **kwargs) File "main.py", line 37, in on_ready member_id = int(data[0]) ValueError: invalid literal for int() with base 10: 'Kar' Ignoring exception in on_message Traceback (most recent call last): File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event await coro(*args, **kwargs) File "/home/runner/THANOS-COMMANDS/currency.py", line 145, in on_message await self.add_credits(message.author) File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 372, in __call__ return await self.callback(self.cog, *args, **kwargs) File "/home/runner/THANOS-COMMANDS/currency.py", line 57, in add_credits result1 = cursor.fetchone()[0] TypeError: 'NoneType' object is not subscriptable

How to fix that? Thank you!

You are viewing a single comment. View All
DwellerIgor (1)

did you see currency.py file? what you are talking about is another function @Coder100