How do I handle the error at the bottom of the code?

import discord
import os
import requests
import json
import random
from replit import db

client = discord.Client()

sad_words = ["sad", "depressed", "annoyed", "fuck life"]

starter_encouragements =["Remember you are not Nitai",
 "At least you are not Nitai",
  "You are great!", 
  "Life goes on" 

def update_encouragements(encouraging_message):
  if "encouragements" in db.keys():
    encouragements = db["encouragements"]    
    db["encouragements"] = encouragements
    db["encouragements"] = [encouraging_message]

def delete_encouragement(index):
  encouragements = db["encouragements"]
  if len(encouragements) > index:
    del encouragements[index]
    db["encouragements"] = encouragements

options = starter_encouragements
if "encouragements" in db.keys():
  options = options + db["encouragements"]


def get_quote():
  response = requests.get("")
  json_data = json.loads(response.text)
  quote = json_data[0]['q'] + " -" + json_data[0]['a']

async def on_ready():
  print('We have logged in as {0.user}'

async def on_message(message):
  if == client.user:

  msg = message.content

  if message.content.startswith("!inspire"):
    quote = get_quote()




  if any(word in msg for word in sad_words):

  if msg.startswith("!show"):

Line  37 
options = options + db["encouragements]
TyepError : can only concatenate list (not "ObservedList") to list

Hello there.

Do you have a question?

If so, please edit your post to include it.

Learning to describe problems is an important part of learning how to code.

Also, the more information you give us, the more likely we are to be able to help.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.