Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
dict problem
#1
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.
Reply
#2
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.
Reply
#3
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Sort a dict in dict cherry_cherry 4 72,899 Apr-08-2020, 12:25 PM
Last Post: perfringo
  dict problem with if Adem 3 2,209 Sep-22-2019, 06:38 AM
Last Post: ndc85430

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020