Discord bot problem

the vid above is uploaded on the official freecodecamp
i entered the same code and did the same ditto steps …
but replit shows error
my discord bot is not coming online nor responding to my messages
:sob:
please someone help me
i’ll post a reply to this topic containing the code i entered along with the error replit shows…

import os
import requests 
import json

client = discord.Client()

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)

 response = requests.get("https://zenquotes.io/api/random")
 json_data = json.loads(response.text)
 quote = json_data[0] ['q'] + " -" + 
 json_data[0] ['a'

@client.event
async def on_ready():
  print('we have logged in as {0.user}'
  .format(client))

@client.event
async def on_message(message):
  if message.author == client.user:
    return

  if message.content.startswith('$inspire'):
    quote = get_quote()
    await message.channel.send(quote)

client.run(os.getenv('TOKEN'))

:arrow_double_up: input in repl it

  File "main.py", line 15
    response = requests.get("https://zenquotes.io/api/random")
                                                             ^
IndentationError: unindent does not match any outer indentation level

:arrow_double_up: output in terminal
shows error :frowning:
please someone help me and please tell me all the errors and solutions

your indentation of that code block doesn’t match any indentetion, you would need to have it more indented or less indented, also, what use does it have, you have it equal a couple of lines above? you can probably just remove it

This is not about the code itself but more about the discord.py module. If you are genuinely considering making a discord.py bot I heavily advise you to check out the documentation for discord.py. The creator and sole maintainer, R. Danny, said he is discontinuing development for the module. You can learn more about it here. You can still make a discord bot in python of course, and I am sure someone will fork his project and continue it, but I would definitely read up on the module’s documentation and current state. Good luck!

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