I am trying to make a discord bot featuring diagnoses for mild illnesses.
I want the bot to send a message prompting the user to send symptoms and see if any match a list of symptoms for a specific disease.
I can't figure out how to grab the user's input to compare it in the list.
I tried the check(m) method. While it does work with singular keywords, I am trying to clean up the code as much as possible by just checking the ctx to see if it's in the list.
allergy_symptoms = ["sneezing", "runny nose", "congestion", "cough", "wheezing", "shortness of breath", "itchy eyes", "hives", "rash", "itchiness"]
'''Wanted to use buttons in my bot, but if it must be removed I am willing to disband the feature'''
class MyView(discord.ui.View):
@discord.ui.button(label = "Yes", style = discord.ButtonStyle.green)
async def button_callback(self, interaction: discord.Interaction, button: discord.ui.button):
await interaction.response.send_message("Excellent. To start, please list any symptoms you may be experiencing in a single message. For example: I have been experiencing congestion, sneezing, and a runny nose.")
@bot.command()
async def diagnose(ctx):
await ctx.send(f'Hello, I am the R.E.M.E.D.Y. Bot. I can assist you with a diagnosis and recommend a remedy for it.Is this something you are looking for?', view = MyView())
'''I need code here to accept user input to compare it in allergy_symptoms'''
if ctx in allergy_symptoms:
await ctx.send("You may have allergies.")
else:
await ctx.send("You might not have allergies)")