I started coding a command in my discord bot which enables users to interact with the bot using messages. However, when I run my program, I run into this error:
'await' outside async function
I've checked out other posts which said indentation would solve the problem, but I am using a while loop in my code.
@client.command()
async def Bot (ctx):
def Bot1():
while True:
Initiate = input ("Type in anything to start, type 'Quit' to end ")
if Initiate == 'Hello':
await ctx.send ("Hello there!")
elif Initiate == 'Quit':
break
else:
Responses = ['How are you doing today', 'What do you want to talk about', 'The bot is at your service']
Response = random.choose(Responses)
await ctx.send (Response)
await ctx.send (Bot1())
Bot1isn't async but you haveawaits within it.