text: import discord
  import random
  import requests
  import json
  import os
  from replit import db
  from keep_alive import keep_alive
  import time
  
  
  class MyClient(discord.Client):
  
      async def on_ready(self):
          print('Logged on as {0}!'.format(self.user))
  
      async def on_message(self, message):
  
          #emoji are here
          emoji_n = '\U0001F1F3'
          emoji_o = '\U0001F1F4'
          emoji_y = '\U0001F1FE'
          emoji_e = '\U0001F1EA'
          emoji_s = '\U0001F1F8'
          catemoji = '\U0001F431'
          robotmoji = '\U0001F916'
          questionmoji = '\U00002753'
          sadxpeeop = '<:sadxpeeop:809858639284273233>'
  
          def update_encouragements(encouraging_message):
              if "encouragements" in db.keys():
                  temp_variable = db["encouragements"]
                  temp_variable.append(encouraging_message)
                  db["encouragements"] = temp_variable
              else:
                  db["encouragements"] = [encouraging_message]
  
          def update_xadalist(xada_message):
              if "xada_list" in db.keys():
                  temp_xada = db["xada_list"]
                  temp_xada.append(xada_message)
                  db["xada_list"] = temp_xada
              else:
                  db["xada_list"] = [xada_message]
  
          def delete_xadalist(index):
              temp2_xada = db["xada_list"]
              if len(temp2_xada) > index:
                  del temp2_xada[index]
              db["xada_list"] = temp2_xada
  
          def delete_encouragment(index):
              temp2_var = db["encouragements"]
              if len(temp2_var) > index:
                  del temp2_var[index]
              db["encouragements"] = temp2_var
  
          def get_quote():
              response = requests.get("https://zenquotes.io/api/random")
              json_data = json.loads(response.text)
              quote = json_data[0]['q'] + " -" + json_data[0]['a']
              return (quote)
  
          sad_words = ['sad', 'sed', 'dukha', 'naramailo', 'depressed', 'cry']
          ballreply = ['ho ho','haina hola', 'ma ta haina vanxu', 'la mya tyo ta honi', 'testo ni sodnu parxa?', 'euta source bata jankari paye anusar, yes', 'feri sodum na tyo kti lai herdai thiye kya', 'thait teri haina ni', 'tempted to say yes, tara haina mula','tyo ~~pardaia~~ haina', 'raixa tani kyarnu', 'eh ma ta dud mam khadai xu ekxin la feri sodnu']
  
          other_bot_prefixes = ['$','.',"-",'!',"<",">"]
  
          if message.author == client.user:
              return
          if message.author.bot:
              return
  
          if client.user.mentioned_in(message):
              await message.channel.send(
                  "distap nagarnu na ,\n$help use garnu baru")
  
          if any(word in message.content for word in sad_words) and not list(filter(message.content.strip().startswith, other_bot_prefixes))!=[]:
            await message.add_reaction(sadxpeeop)
            await message.channel.send(random.choice(db["encouragements"]))
  
          if message.content.strip().startswith("$cattu") and len(message.content.strip()) > 7:
              msgauthor = str(message.author).split("#",1)[0]
              await message.channel.send("`{}".format(msgauthor)+" used $cattu`"+'\n' + message.content.strip()[7:])
              await message.delete()
  
          if message.content.strip().startswith("$randomcat"):
              msgauthor = str(message.author).split("#",1)[0]
              await message.channel.send("`{}".format(msgauthor)+" used $randomcat`\n" + random.choice(db["xada_list"]))
              await message.delete()
  
          if message.content.strip().startswith("$help"):
              await message.channel.send("""```List of commands 
  
  $help, $cattu <message>, $randomcat, $inspire, $8ball <yes/no qn>, $brawl
  
  For further explanation use $cmduses in bot channels```""")
  
          if message.content.strip().startswith("$cmduses"):
              await message.channel.send("""```Command uses
  .
  $cattu <message>
  The same message but from bot.
  .
  $randomcat 
  Random message from cat.
  .
  $8ball <yes/no qn>
  Yes no qn
  $inspire
  Inspirational quotes
  .
  $allrandcat
  See all random cat list.```""")
              await message.channel.send(file=discord.File('help.png'))
  
          if "cat" in message.content.strip() and not list(filter(message.content.strip().startswith, other_bot_prefixes))!=[]:
              await message.add_reaction(catemoji)
  
          if "$brawl" in message.content.strip() and message.content.strip().startswith("$"):
              await message.channel.send(
                  "<@&836173766928105502> khelna aaiyos dada haru")
  
          if "fifi" in message.content.strip().lower() and not list(filter(message.content.strip().startswith,other_bot_prefixes))!=[]:
              await message.channel.send("FIFI Queen")
  
          if message.content.strip().lower().startswith("hello"):
  
              await message.channel.send("hello i hope you are doing well :pleading_face: <3")
  
          if "kina" in message.content.strip() and not list(filter(message.content.strip().startswith, other_bot_prefixes))!=[]:
              await message.add_reaction(questionmoji)
          if message.content.strip().lower().startswith("yes"):
              await message.add_reaction(emoji_n)
              await message.add_reaction(emoji_o)
  
          if message.content.strip().lower().startswith("no"):
              await message.add_reaction(emoji_y)
              await message.add_reaction(emoji_e)
              await message.add_reaction(emoji_s)
  
          if "bot " in message.content.strip() and not list(filter(message.content.strip().startswith, other_bot_prefixes))!=[]:
              await message.add_reaction(robotmoji)
  
          if message.content.startswith('$inspire'):
              quote = get_quote()
              await message.channel.send(quote)
              await message.delete()
  
          if message.content.startswith('$allinspire'):
              allval = db["encouragements"]
              await message.channel.send(allval)
  
          if message.content.startswith("$addinspire") and message.author == "<@314417483668783105>":
              encourage_variable = message.content.split("$addinspire ", 1)[1]
              update_encouragements(encourage_variable)
              await message.channel.send("New encouraging message added.")
  
          if message.content.startswith("$reminspire"):
              new_encourage = []
              if "encouragements" in db.keys():
                  index = int(message.content.split("$reminspire", 1)[1])
                  delete_encouragment(index)
                  new_encourage = db["encouragements"]
              await message.channel.send(new_encourage)
  
          if message.content.startswith("$randcatnew"):
              xada_variable = message.content.split("$randcatnew ", 1)[1]
              update_xadalist(xada_variable)
              await message.channel.send("New $randomcat message added.")
  
          if message.content.startswith('$allrandcat'):
              allcat = db["xada_list"]
              await message.channel.send(allcat)
              await message.delete()
  
  
          if message.content.startswith("$randcatdel"):
              new_xada = []
              if "xada_list" in db.keys():
                  index = int(message.content.split("$randcatdel", 1)[1])
                  delete_xadalist(index)
                  new_xada = db["xada_list"]
              await message.channel.send(new_xada)
  
          if message.content.startswith("$8ball"):
            if len(message.content)<=7:
              await message.channel.send("Ask a yes no question.")
            else:
              await message.channel.send(random.choice(ballreply))
  
  keep_alive()
  activity = discord.Activity(name='$help and $cmduses', type=discord.ActivityType.watching)
  client = MyClient(activity=activity)
  #client = MyClient()
  client.run(os.getenv('token'))
  