Closed Mehul343 closed 2 years ago
wait_for message_edit isn't doing anything
Run the code send the command followed by a message "hi" then edit that message. wait_for message works but wait_for message_edit doesn't.
from selfcord.ext import commands import asyncio bot = commands.Bot(command_prefix=';', self_bot=True) def check(m): return m.author.id == userid and m.channel.id == channelid @bot.command() async def hi(ctx): if ctx.channel.id == channelid and ctx.author.id == userid: try: try: msg = await bot.wait_for("message", check=check, timeout=10) except: pass else: print("worked 1") if "hi" in msg.content: try: edited_msg = await bot.wait_for('message_edit', check=check, timeout=20) except asyncio.TimeoutError: print("Timeout") else: print("Worked 2") except: pass bot.run(token)
It should print worked 1 then worked 2.
It prints worked 1 but not worked 2 or timeout which means wait_for message_edit isn't doing anything.
No response
First of all, you're on an old version of the library.
I figured it out myself checks for message_edit requires 2 arguments.
Summary
wait_for message_edit isn't doing anything
Reproduction Steps
Run the code send the command followed by a message "hi" then edit that message. wait_for message works but wait_for message_edit doesn't.
Code
Expected Results
It should print worked 1 then worked 2.
Actual Results
It prints worked 1 but not worked 2 or timeout which means wait_for message_edit isn't doing anything.
System Information
Checklist
Additional Information
No response