What I'm trying to do: I am trying to return a command when it is called after you send a message.
What I sent: command hello
Result: function() NameError: name 'function' is not defined
How can I fix this?
Code:
@bot.command()
async def command():
global variable
variable = False
async def function():
variable = True
if variable == True:
return
@bot.event
async def on_message(message):
function()
await bot.process_commands(message)