tgcf icon indicating copy to clipboard operation
tgcf copied to clipboard

Replace plugin does not change the raw_text attribute of TgcfMessage

Open aahnik opened this issue 4 years ago • 1 comments

thus a plugin such as format (which works on raw_text), if placed after replace, will negate the effect of replace.

https://github.com/aahnik/tgcf/blob/41896d19d91ff5d14f4908d878f679f642d94216/tgcf/plugins/replace.py#L26-L29

A smart way must be used to keep the text and raw_text attributes in sync thru out the plugin pipeline.

aahnik avatar Jun 09 '21 14:06 aahnik

Telethon's message object is smart, and it updates the raw_text when text is updated. For TgcfMessage object, proper getters and setters need to be defined, that will take advantage of telethon's message object.

aahnik avatar Jun 27 '21 03:06 aahnik