Python Forum

Full Version: dict problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there,

I have recently been creating a bot for Discord, I have seeked help on other discord servers, but no one can help. I know I should know about dicts if I know anything about python but anyway. When I run my code it says: TypeError: 'dict' object is not callable, unclosed client session. Here's what I have tried to fix it, remove that part of code, copied the code, deleted the python save, then created a new one, and pasted the code. I have removed the word 'dict'. It still will come up with the problem, even when the code isn't there, please tell me how to fix this as this is really annoying. Thank you, have a great day.
Hello, it is nearly impossible to help without seeing your code. So post it here (in Python code tags), and full error traceback message in error tags.
Ok, I will do that once I get back to my pc, thank you.

Here is the code with the error, it says the error is at line 38/37
 @bot.commands(pass_context=True)
async def cr(ctx, msgId, user: discord.Member):
    msg = await bot.get_message(ctx.message.channel, msgId)
    await bot.clear_reactions(msg)
    await bot.say("A message's reactions have been removed by {}".format(user.name)) 

Line 37/38 is Line 1/2 for you guys

And here is the Traceback message in cmd prompt:

"Traceback (most recent call last):
File "C:\Users\Sol\Desktop\Bots on Discord\JayBot\test.py", line 38, in <module>
@bot.commands(pass_context=True)
TypeError: 'dict' object is not callable
Unclosed client session"

FIXED!!!!!! I had but @bot.commands, it is supposed to be @bot.command IT'S NOW FIXED