I’m currently running bots through discord with a python script. There is a chain of questioning where the bot successfully doesn’t respond to itself. At the end, I type the word “proceed” and the bot generates a response. However, the bot always seems to respond to itself because I can’t seem to successfully exit the loop and start the on_message event again.
Start of function that I can’t seem to exit:
async def gather_requirements(message, task_id, requirements, lock, client, req_gathering_bot, DESIGN_CHANNEL_NAME, STATE_FILE, LOG_FILE):
if message.author == req_gathering_bot.user:
return
End of function that is successfully completed:
if requirements_doc:
await post_requirements_to_channel(message, task_id, requirements_doc, DESIGN_CHANNEL_NAME, STATE_FILE, LOG_FILE)
return
Main.py event start:
@req_gathering_bot.event
async def on_message(message):
print(“on-message”,message.author, req_gathering_bot.user)
if message.author == req_gathering_bot.user or not message.content:
return
I can share more, but thought this might be enough for someone to understand and help me out. Hoping there’s an expert out there that can help!
A lot of things have been tried, but none have worked lol
Benjamin Glick is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.