-
-
Notifications
You must be signed in to change notification settings - Fork 480
Closed
Labels
unconfirmed bugA bug report that needs triagingA bug report that needs triaging
Description
Summary
using a discord.Message as a boolean no longer works.
Reproduction Steps
msg = some discord.Message object
if msg:
print('yes')
the print doesn't get printed
this appears to have been broken sometime between 1.7.3 to 2.0.0a as downgrading from 2.0.0a to 1.7.3 solved the issue.
Minimal Reproducible Code
# get msg
msg = None
msg_id = Support.get_id_from_str(args[3])
msg_id = int(msg_id[0]) if msg_id else None
try:
msg = await channel.fetch_message(msg_id) if channel and msg_id else None
except discord.errors.NotFound:
pass # error message below
if msg and msg.author.id == Support.ids.phyner_id: # msg found and phyner is author
embed = msg.embeds[0] if msg.embeds else None
...Expected Results
normally, if it found the message, it would enter that bottom if statement given msg is not None
Actual Results
it doesn't consider if msg != None equal to if msg:
Intents
intents = discord.Intents.all()
System Information
python 3.9.5
py-cord 2.0.0a
py-cord 1.7.3 appears to work
Checklist
- I have searched the open issues for duplicates.
- I have shown the entire traceback, if possible.
- I have removed my token from display, if visible.
Additional Context
No response
Metadata
Metadata
Assignees
Labels
unconfirmed bugA bug report that needs triagingA bug report that needs triaging
