If you're looking to use the $2 identifier, you need to specify in the event to allow wildcards.
Your other else statement is placed wrong btw. You need to place it after the ending bracket from the first if statement.
And you want to use $+ before $2 as well, since otherwise it will look like this: twitch.tv/ whatever instead of twitch.tv/whatever