Inspirational Discord Bot API function not working

Hi there,
I’ve been following the Python Discord Bot tutorial and appear to have hit an issue.
When I run the code and send the “$inspire” message in the server, the bot responds with:
“<function get_quote at 0x7f2d3bc86280>”
There’s no error when running the code, so I figured it just isn’t reading the api correctly but I’m not sure.
Any help would be appreciated and I’ve also posted my code

import discord
import os
import requests
import json

client = discord.Client()

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

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

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

  if message.content.startswith("$hello"):

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

you are defining here what is printed, and get_quote is a function
maybe you wanted to call the function so to get its output?

Thank you!
Turns out I was just missing the () after get_quote, it’s all working find now :smiley:

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