mirror of
https://github.com/stoatchat/python-client-sdk.git
synced 2026-07-21 18:15:28 -04:00
Message.edit() does not let you use None to clear a message's content #22
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @MysticMia on GitHub (Jun 19, 2023).
Describe the bug
Unlike member.edit() where you can reset someone's username by passing None, you can't clear a message's content by editing it using None.
To Reproduce
Expected behavior
Expected message content to clear. This did not happen, however.
Library version
0.1.11
Additional context
This is likely caused by the following code:
Instead of setting the default to and checking for revolt.utils.Missing, it sets/checks it None. This means you can't un-set something by passing the None argument because it'll be filtered out as 'default' argument.
@MysticMia commented on GitHub (Jun 19, 2023):
It works if you pass
""(an empty string) for the message content, instead of None.@Zomatree commented on GitHub (Jun 20, 2023):
You cant pass
Noneto clear the content, the Revolt API does not support that.