Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support mentions #13

Open
donaghhorgan opened this issue Jun 17, 2022 · 2 comments · Fixed by #15
Open

Support mentions #13

donaghhorgan opened this issue Jun 17, 2022 · 2 comments · Fixed by #15

Comments

@donaghhorgan
Copy link

It would be nice if the Message class had a mentions method that you could use to check whether a given message mentioned a given user, e.g. something along the lines of this:

message = Message.parse(...)
if message.mentions("+1234567890"):
    do_something()

I'd be happy to contribute a PR if you're open to it?

@tzabian
Copy link
Contributor

tzabian commented Jan 12, 2023

@filipre the above PR adds mentions to the Message container. Also added raw_message which currently always returns None

@filipre
Copy link
Owner

filipre commented Mar 25, 2023

Thank you again @tzabian . mentions will be available in the next release.

Right now, mentions contains a list of dict looking like this

{'name': '+49123456789', 'number': '+49123456789', 'uuid': 'asdfasdfasdf-asdfasdfasdf-asdf-asdfasd', 'start': 9, 'length': 1}

I may add the check from OP at some point later

@filipre filipre reopened this Mar 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants