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

How to access tags (ircv3.TaggedMessageSupport) #35

Open
svkurowski opened this issue Jun 10, 2016 · 1 comment
Open

How to access tags (ircv3.TaggedMessageSupport) #35

svkurowski opened this issue Jun 10, 2016 · 1 comment

Comments

@svkurowski
Copy link

I am interested in accessing the tags of private messages. Currently I do this in the following fashion:

class PrivMessageTagSupport(pydle.features.ircv3.TaggedMessageSupport):
  def on_raw_privmsg(self, message):
    """ PRIVMSG command. """
    nick, metadata = self._parse_user(message.source)
    tags = message.tags
    target, message = message.params

    self._sync_user(nick, metadata)

    self.on_message(target, nick, message, tags)
    if self.is_channel(target):
        self.on_channel_message(target, nick, message, tags)
    else:
        self.on_private_message(nick, message, tags)

Which is mostly a copy-paste of the on_raw_privmsg method of RFC1459Support and feels kind of messy. Is this the recommended way of handling tagged messages? Or do you have any plans to make access of tags easier in the library?

Thanks for the great work btw!

@shizmob
Copy link
Owner

shizmob commented Jun 18, 2016

Hi! Accessing tags in an easier way is definitely planned, I'm just still mulling over the API for it. Right now, this sadly is the best way. I'm hoping to have it added in 0.9.

Thanks for using!

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

No branches or pull requests

2 participants