# Unable to register for IRC capabilities

**URL:** <https://discuss.dev.twitch.com/t/unable-to-register-for-irc-capabilities/27023>\
**Category:** Chat and IRC\
**Created:** [July 9, 2020, 10:12pm UTC](https://discuss.dev.twitch.com/t/unable-to-register-for-irc-capabilities/27023 "2020-07-09T22:12:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![LeviPorton](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/leviporton/32/10264_2.png) [@LeviPorton](https://discuss.dev.twitch.com/u/LeviPorton)\
**Post date:** [July 9, 2020, 10:12pm UTC](https://discuss.dev.twitch.com/t/unable-to-register-for-irc-capabilities/27023/1 "2020-07-09T22:12:59Z")

</div>

I’ve started making a chat bot in python.  
It works for everything PRIVMSG related, that is, until I add code to request capabilities.

```
s = socket.socket()
s.connect((HOST, PORT))
s.send("PASS " + AUTH + "\r\n")
s.send("NICK " + ID + "\r\n")
s.send("CAP REQ :twitch.tv/membership")
s.send("CAP REQ :twitch.tv/commands")
s.send("CAP REQ :twitch.tv/tags")
s.send("JOIN #" + ROOM + "\r\n")

```

This is the code I’m using to do so and it results in

```
:tmi.twitch.tv 001 leviporton :Welcome, GLHF!
:tmi.twitch.tv 002 leviporton :Your host is tmi.twitch.tv
:tmi.twitch.tv 003 leviporton :This server is rather new
:tmi.twitch.tv 004 leviporton :-
:tmi.twitch.tv 375 leviporton :-
:tmi.twitch.tv 372 leviporton :You are in a maze of twisty passages, all alike.
:tmi.twitch.tv 376 leviporton :>
:tmi.twitch.tv CAP * NAK :twitch.tv/membershipCAP REQ :twitch.tv/commandsCAP REQ :twitch.tv/tagsJOIN #leviporton

```

It does not connect to the channel, where did I go wrong?

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [July 9, 2020, 10:15pm UTC](https://discuss.dev.twitch.com/t/unable-to-register-for-irc-capabilities/27023/2 "2020-07-09T22:15:01Z")

</div>

```auto
s.send("CAP REQ :twitch.tv/membership")
s.send("CAP REQ :twitch.tv/commands")
s.send("CAP REQ :twitch.tv/tags")

```

should be

```auto
s.send("CAP REQ :twitch.tv/membership\r\n")
s.send("CAP REQ :twitch.tv/commands\r\n")
s.send("CAP REQ :twitch.tv/tags\r\n")

```

or

```auto
s.send("CAP REQ :twitch.tv/membership twitch.tv/commands twitch.tv/tags\r\n")

```

You were not terminating your lines with a carriage return

---

<div class="post-metadata">

**Author:** ![LeviPorton](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/leviporton/32/10264_2.png) [@LeviPorton](https://discuss.dev.twitch.com/u/LeviPorton)\
**Post date:** [July 9, 2020, 10:17pm UTC](https://discuss.dev.twitch.com/t/unable-to-register-for-irc-capabilities/27023/3 "2020-07-09T22:17:27Z")

</div>

I’ve been pulling my hair out over this for a few hours now, that fixed it.

Thank you so much.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [July 10, 2020, 1:09am UTC](https://discuss.dev.twitch.com/t/unable-to-register-for-irc-capabilities/27023/4 "2020-07-10T01:09:33Z")

</div>

> [@LeviPorton](#):
>
> Thank you so much.

Welcome, glad to have been of help!

---

<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:** [August 9, 2020, 1:09am UTC](https://discuss.dev.twitch.com/t/unable-to-register-for-irc-capabilities/27023/5 "2020-08-09T01:09:35Z")

</div>

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