Discord Bot code Type Error

Hey, I was watching the same video today and experienced the same error. I’ll let you know if I manage to fix it.

Try using one of the other methods of list concatenation. The following worked for me -



encouragements.appen(encouraging_message) is now giving an error. can you kindly help?

This Really Helped. Thanks

Where exactly do we add that in? When I tried that, it still seemed to hate the line

options = options + db[“encouragements”]

Guys, the following line helped me

base = base + list(db['YOUR KEY FROM DB'])
invalid literal for int() with base 10: ' hi'   

I keep getting this error after running $del hi in discord

Hi, there. I have also been watching the tutorial video on how to create a bot. I have received a similar error. I have copied the code exactly from the video but somehow it always shows this as an error:

At first I thought it was because I had misspelled ‘encouragement’ a couple of times but after fixing that, the problem was still there.

Could anyone help me fix it?

thanks it worked…but soon later it gave this error UnboundLocalError: local variable ‘encouragements’ referenced before assignment and later the $del function didnt work.

Guys if you are getting the same error use this below code.
options = options + list(db[‘encouragements’])
it worked for me.


What it is printing–>

this helped me, thank you!

thankyou sir u helped me alot by this comment

@pranabsaha1130 Its Not Appen Its Append, I made this Mistake Too. :wink:

I found The Solution You can Use

options = options.extend(db[“encouragements”])

it does not work if you try $del

same. Need help with this

this worked! also can we note how cool the comment box pop-up is? Also, this freecodecamp site should be in the internet history books. Are we about to have a dot-com bubble burst again? Internet looks middle-school-ey

same. Can some1 please help me with this…

this solved my issue