@bot.event
async def on_member_update(before, after):
print(before.timeout)
print(after.timeout)
if before.timeout != after.timeout:
print("Timeout status changed")
else:
print("No change")
This is my code, and I’ve been trying to detect changes in a user’s timeout status. When I try to print the two statements and check them side by side, I’m certain they are the same. However, when timing out a server member, it prints that the Timeout Status changed.
<bound method Member.timeout of <Member id=833849503169380433 name='savageicebear1' global_name='Savageicebear' bot=False nick=None guild=<Guild id=1231710097923772528 name='Testing' shard_id=0 chunked=True member_count=4>>>
<bound method Member.timeout of <Member id=833849503169380433 name='savageicebear1' global_name='Savageicebear' bot=False nick=None guild=<Guild id=1231710097923772528 name='Testing' shard_id=0 chunked=True member_count=4>>>
Timeout status changed
This is already a very stripped-down version, and I would assume that when printing, it would be different between the before.timeout
and the after.timeout
, likely in a value along the lines of value=True
or value=False
to indicate the change, although I’m not sure what it’s supposed to look like.
I am looking to be able to visibly see if it’s changed through the print statement (or another way, if required), and to differentiate between timeouts being added and timeouts being removed. How would I accomplish that?
Logan Bingham is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.