I wanted to combine a discord bot with a command line application. However, after the function fruit() is being called on startup, my discord bot commands will not work (no errors). The fruit() function will be runned infinitely after the bot is ran. Any code after client.run will not work. Any solutions to fix my code so that, upon running the script, activates the commands and run the bot, then run the main function forever?
from discord.ext import commands
token = "my token"
client = commands.Bot(command_prefix=">")
def fruit():
option = input("Choose a fruit, 1 for banana, 2 for lime")
if option == 1:
print("Bananas are sweet")
fruit()
elif option == 2:
print("Limes are sour")
fruit()
else:
print("Invalid option")
fruit()
@client.command()
async def sayhi(ctx):
await ctx.send("Hi")
@client.event
async def on_ready():
fruit()
client.run(token)```