# How to grab messages when using tags (Python)

**URL:** <https://discuss.dev.twitch.com/t/how-to-grab-messages-when-using-tags-python/11513>\
**Category:** Chat and IRC\
**Created:** [August 22, 2017, 8:47am UTC](https://discuss.dev.twitch.com/t/how-to-grab-messages-when-using-tags-python/11513 "2017-08-22T08:47:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![joveice](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@joveice](https://discuss.dev.twitch.com/u/joveice)\
**Post date:** [August 22, 2017, 8:47am UTC](https://discuss.dev.twitch.com/t/how-to-grab-messages-when-using-tags-python/11513/1 "2017-08-22T08:47:09Z")

</div>

So what I got now is

```auto
CHAT_MSG = re.compile(r"^:\w+!\w+@\w+\.tmi\.twitch\.tv PRIVMSG #\w+ :")
```

This worked with non tags, but now with the tags how can I grab the messages? I also want to grab if he is a mod or not, broadcaster etc.

How can I do that?

I have practical no experience with python, but I have coded C# and PHP before.

// Jove

---

<div class="post-metadata">

**Author:** ![3ventic](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/3ventic/32/298_2.png) [@3ventic](https://discuss.dev.twitch.com/u/3ventic)\
**Post date:** [August 22, 2017, 4:22pm UTC](https://discuss.dev.twitch.com/t/how-to-grab-messages-when-using-tags-python/11513/2 "2017-08-22T16:22:49Z")

</div>

Here’s one way to parse an IRCv3 message:

 ![image](https://d3ovvz0v2ajtpu.cloudfront.net/uploads/default/original/2X/b/bc1d98cff1bd2c2e055093f291929d1768c155d0.png)

---

<div class="post-metadata">

**Author:** ![system](https://d2opxh93rbxzdn.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://discuss.dev.twitch.com/u/system)\
**Post date:** [September 21, 2017, 4:23pm UTC](https://discuss.dev.twitch.com/t/how-to-grab-messages-when-using-tags-python/11513/3 "2017-09-21T16:23:01Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
