[Python] How to remove Slack emoji while processing text?

Discussão em 'Python' iniciado por Stack, Outubro 1, 2024.

  1. Stack

    Stack Membro Participativo

    I'm using Slack Python SDK, I'm reading Slack messages via API. I want to remove the emoji from the text and any other unneeded characters before processing the text, how to do that? I'm working with English and German Characters, but mostly English.

    As far as I can tell and forgive me if I'm wrong, reactions.remove is used to write text back to the slack channel, that's why it requires write permission, I want to do text processing without writing back to the channel.

    I don't know if slack supports unicode emojis but for now I see :slightly_smiling_face, so I don't think I can remove them by regex.

    An example API response message that includes the emoji


    I also created another channel called foo for more extensive testing :slightly_smiling_face:
    ​

    What I expect to get


    I also created another channel called foo for more extensive testing
    ​

    Continue reading...

Compartilhe esta Página