mIRC Home    About    Download    Register    News    Help

Topic Options
#258258 - 21/06/16 06:53 PM [Twitch] Important Change to Resub Notifications
keyeslol Offline
Vogon poet

Registered: 15/05/15
Posts: 133
All,

before a ton of posts get made here to ask why their resubs no longer are being seen, you can read about it here: https://discuss.dev.twitch.tv/t/important-re-subscription-change/6463

I have the following code to account for this change (credit goes to JACKY1356400) :

Code:
raw USERNOTICE:*:{
  if ($msgtags(room-id).key == [CHANNEL ID HERE]) {
    if ($2- == $null) && (resub isin $msgtags) {
      msg $1 Welcome back $msgtags(display-name).key has resubscribed for $msgtags(msg-param-months).key months in a row!
    }
    else {
      msg $1 Welcome back $msgtags(display-name).key has resubscribed for $msgtags(msg-param-months).key months in a row with the message $2-
    }
  }
}


You'll need to get your room-id, i recommend debugging @raw and pulling the ID. Run the following:

Code:
//window -e @raw | debug @raw


Then change your key in the referenced code.
_________________________
twitter @keyeslol

Top
#258262 - 22/06/16 12:42 AM Re: [Twitch] Important Change to Resub Notifications [Re: keyeslol]
Khonor Offline
Babel fish

Registered: 23/06/14
Posts: 77
Hey @keyeslol,

So to get the Room-ID would be something as this?


Quote:
on *:TEXT:!roomid *:#: {
if ($nick == $me) { .timermsg 1 1 /msg # Room ID: $msgtags(room-id).key }
}

Top
#258276 - 23/06/16 04:19 PM Re: [Twitch] Important Change to Resub Notifications [Re: Khonor]
keyeslol Offline
Vogon poet

Registered: 15/05/15
Posts: 133
You can get it by putting this in a new remotes:

Code:
on *:TEXT:*:#: {
  if ($nick == $me) {
  msg # Room ID: $msgtags(room-id).key
  }
}
_________________________
twitter @keyeslol

Top
#258278 - 23/06/16 04:47 PM Re: [Twitch] Important Change to Resub Notifications [Re: keyeslol]
Khonor Offline
Babel fish

Registered: 23/06/14
Posts: 77
Hi @keyeslol,

With this, the bot would have to be able to pick up the "Room-ID" of each channel automatically?

Top
#258279 - 23/06/16 06:13 PM Re: [Twitch] Important Change to Resub Notifications [Re: Khonor]
keyeslol Offline
Vogon poet

Registered: 15/05/15
Posts: 133
That is correct. Just have the bot type anything in the channel you need the room-id for.

We could technically do this all automatically, write this to a var, like %roomid. < key > .channel and call this in our resub.

Instead of the room-id == [ ID HERE ] it would be room-id == %room.id

I'd have to write the code though to do it all automatically. But here's the thing, i wouldn't want to process the on * event all the time, as i only need the room ID once.

Better to just grab it once, instead of writing the ID to a var.
_________________________
twitter @keyeslol

Top
#258288 - 23/06/16 08:52 PM Re: [Twitch] Important Change to Resub Notifications [Re: keyeslol]
Khonor Offline
Babel fish

Registered: 23/06/14
Posts: 77
Something like this works? I apologize if you have errors and ask many questions, it's just I'm new to mIRC.



Original:


Quote:
raw USERNOTICE:*:{
if ($msgtags(room-id).key == [CHANNEL ID HERE]) {
if ($2- == $null) && (resub isin $msgtags) {
msg $1 Welcome back $msgtags(display-name).key has resubscribed for $msgtags(msg-param-months).key months in a row!
}
else {
msg $1 Welcome back $msgtags(display-name).key has resubscribed for $msgtags(msg-param-months).key months in a row with the message $2-
}
}
}



Example edited script:


Quote:
raw USERNOTICE:*:{
if ($chan == #channame && ( $msgtags(msg-id).key == resub)) {

Top
#258289 - 23/06/16 09:15 PM Re: [Twitch] Important Change to Resub Notifications [Re: Khonor]
keyeslol Offline
Vogon poet

Registered: 15/05/15
Posts: 133
No need to check if $chan == xxx && room-id == xxx

room-id is unique, and only for the channel the resub occurs in. Use my original code, and reference the room-id where it says [channel id]
_________________________
twitter @keyeslol

Top
#258292 - 23/06/16 09:32 PM Re: [Twitch] Important Change to Resub Notifications [Re: keyeslol]
Khonor Offline
Babel fish

Registered: 23/06/14
Posts: 77
Well thank you very much for all the information and help @keyeslol. Very thankful.

Top
#258306 - 24/06/16 10:55 AM Re: [Twitch] Important Change to Resub Notifications [Re: Khonor]
Artiiz Offline
Ameglian cow

Registered: 03/04/15
Posts: 42
Loc: Sweden
@keyeslol

So this one should work fine then?
I've put "#yznb", because I only want it to type in that channel, since I'm connected to more than 1 in IRC.

Code:
raw USERNOTICE:*:#yznb:{
  if ($msgtags(room-id).key == [31582993]) {
    if ($2- == $null) && (resub isin $msgtags) {
      msg $1 xanHY xanPE yznSOLD (&#65417;&#9685;&#12526;&#9685;)&#65417; &#10023; ( $+ $msgtags(display-name).key $+ ) stayed on #YZNARMY for ( $+ $msgtags(msg-param-months).key $+ ) months! yznLOVE yznHYPE
    }
    else {
      msg $1 xanHY xanPE yznSOLD (&#65417;&#9685;&#12526;&#9685;)&#65417; &#10023; ( $+ $msgtags(display-name).key $+ ) stayed on #YZNARMY for ( $+ $msgtags(msg-param-months).key $+ ) months! yznLOVE yznHYPE ( Note: $2- )
    }
  }
}

Top
#258314 - 24/06/16 07:16 PM Re: [Twitch] Important Change to Resub Notifications [Re: Artiiz]
keyeslol Offline
Vogon poet

Registered: 15/05/15
Posts: 133
You don't need to put the channel in, as the room-id is unique to the channel the resub occurs in. IE, it won't display in any other channel than the one the room-id is tied to. But it doesn't hurt if you want to have it in there. Technically it saves a minuscule amount of CPU.

Originally Posted By: Artiiz
@keyeslol

So this one should work fine then?
I've put "#yznb", because I only want it to type in that channel, since I'm connected to more than 1 in IRC.

Code:
raw USERNOTICE:*:#yznb:{
  if ($msgtags(room-id).key == [31582993]) {
    if ($2- == $null) && (resub isin $msgtags) {
      msg $1 xanHY xanPE yznSOLD (&#65417;&#9685;&#12526;&#9685;)&#65417; &#10023; ( $+ $msgtags(display-name).key $+ ) stayed on #YZNARMY for ( $+ $msgtags(msg-param-months).key $+ ) months! yznLOVE yznHYPE
    }
    else {
      msg $1 xanHY xanPE yznSOLD (&#65417;&#9685;&#12526;&#9685;)&#65417; &#10023; ( $+ $msgtags(display-name).key $+ ) stayed on #YZNARMY for ( $+ $msgtags(msg-param-months).key $+ ) months! yznLOVE yznHYPE ( Note: $2- )
    }
  }
}
_________________________
twitter @keyeslol

Top
#258315 - 24/06/16 07:28 PM Re: [Twitch] Important Change to Resub Notifications [Re: keyeslol]
Artiiz Offline
Ameglian cow

Registered: 03/04/15
Posts: 42
Loc: Sweden
Originally Posted By: keyeslol
You don't need to put the channel in, as the room-id is unique to the channel the resub occurs in. IE, it won't display in any other channel than the one the room-id is tied to. But it doesn't hurt if you want to have it in there. Technically it saves a minuscule amount of CPU.

Originally Posted By: Artiiz
@keyeslol

So this one should work fine then?
I've put "#yznb", because I only want it to type in that channel, since I'm connected to more than 1 in IRC.

Code:
raw USERNOTICE:*:#yznb:{
  if ($msgtags(room-id).key == [31582993]) {
    if ($2- == $null) && (resub isin $msgtags) {
      msg $1 xanHY xanPE yznSOLD (&#65417;&#9685;&#12526;&#9685;)&#65417; &#10023; ( $+ $msgtags(display-name).key $+ ) stayed on #YZNARMY for ( $+ $msgtags(msg-param-months).key $+ ) months! yznLOVE yznHYPE
    }
    else {
      msg $1 xanHY xanPE yznSOLD (&#65417;&#9685;&#12526;&#9685;)&#65417; &#10023; ( $+ $msgtags(display-name).key $+ ) stayed on #YZNARMY for ( $+ $msgtags(msg-param-months).key $+ ) months! yznLOVE yznHYPE ( Note: $2- )
    }
  }
}


Oh alright.

I tried using this earlier today but it didn't quite seem to be working anyway.
Do I need to make a whole new Remote script for this, and restart mIRC after writing it in?

Top
#258323 - 25/06/16 02:35 AM Re: [Twitch] Important Change to Resub Notifications [Re: Artiiz]
keyeslol Offline
Vogon poet

Registered: 15/05/15
Posts: 133
Try taking out the brackets after room-id.key ==
_________________________
twitter @keyeslol

Top
#258326 - 25/06/16 07:44 AM Re: [Twitch] Important Change to Resub Notifications [Re: keyeslol]
ifuse Offline
Mostly harmless

Registered: 25/06/16
Posts: 1
I'm guessing that I need to do raw CAP REQ :twitch.tv/tags. But when I do it, my bot wont get any of the chat messages from twitch. Do I need to add/do a script to capture chat or something?

Top
#258333 - 25/06/16 03:10 PM Re: [Twitch] Important Change to Resub Notifications [Re: Artiiz]
Khonor Offline
Babel fish

Registered: 23/06/14
Posts: 77
Hey @Artiiz,


Actually in the Room-ID is not going "[ ]" or the bot will not respond you, at least in my case did not.





Quote:
raw USERNOTICE:*:#yznb:{
if ($msgtags(room-id).key == 31582993) {
if ($2- == $null) && (resub isin $msgtags) {
msg $1 xanHY xanPE yznSOLD (&#65417;&#9685;&#12526;&#9685;)&#65417; &#10023; ( $+ $msgtags(display-name).key $+ ) stayed on #YZNARMY for ( $+ $msgtags(msg-param-months).key $+ ) months! yznLOVE yznHYPE
}
else {
msg $1 xanHY xanPE yznSOLD (&#65417;&#9685;&#12526;&#9685;)&#65417; &#10023; ( $+ $msgtags(display-name).key $+ ) stayed on #YZNARMY for ( $+ $msgtags(msg-param-months).key $+ ) months! yznLOVE yznHYPE ( Note: $2- )
}
}
}

Top
#258340 - 25/06/16 11:37 PM Re: [Twitch] Important Change to Resub Notifications [Re: keyeslol]
Bnz Offline
Mostly harmless

Registered: 25/06/16
Posts: 1
Hi im a little bit confused.

i used the following script for new subs and resubs and it worked great. Now with the changes sometimes it works, sometimes it doesnt.

Appreciate any help for a solution.


Code:
 

ON *:TEXT:*subscribed*:#channelname:{
  if ( $nick == twitchnotify ) && ($istok($1-,subscribed to,32)) halt
  elseif ($nick == twitchnotify) && ( $4 == $null ) { describe $chan Welcome $1! RANDOM MSG }
  elseif ($nick == twitchnotify) && ( $4 isnum ) { describe $chan Wow! $1 Welcome $1! RANDOM MSG }  
}


Top
#258349 - 26/06/16 04:31 PM Re: [Twitch] Important Change to Resub Notifications [Re: Bnz]
Bestpeff Offline
Babel fish

Registered: 24/04/16
Posts: 86
If the channel name is removed and automatically recognized....I don't understand how it'll work if your bot is connect to multiple Twitch partner's chat??

Top
#258362 - 27/06/16 05:42 PM Re: [Twitch] Important Change to Resub Notifications [Re: ifuse]
keyeslol Offline
Vogon poet

Registered: 15/05/15
Posts: 133
Originally Posted By: ifuse
I'm guessing that I need to do raw CAP REQ :twitch.tv/tags. But when I do it, my bot wont get any of the chat messages from twitch. Do I need to add/do a script to capture chat or something?


What version of mIRC are you using? I'm using the latest, and requesting the following:

Code:
raw CAP REQ :twitch.tv/membership
raw CAP REQ :twitch.tv/tags
raw CAP REQ :twitch.tv/commands


Chat messages appear just fine for me.
_________________________
twitter @keyeslol

Top
#258363 - 27/06/16 05:43 PM Re: [Twitch] Important Change to Resub Notifications [Re: Bnz]
keyeslol Offline
Vogon poet

Registered: 15/05/15
Posts: 133
Take out the last line of your code and use the new code.

Originally Posted By: Bnz
Hi im a little bit confused.

i used the following script for new subs and resubs and it worked great. Now with the changes sometimes it works, sometimes it doesnt.

Appreciate any help for a solution.


Code:
 

ON *:TEXT:*subscribed*:#channelname:{
  if ( $nick == twitchnotify ) && ($istok($1-,subscribed to,32)) halt
  elseif ($nick == twitchnotify) && ( $4 == $null ) { describe $chan Welcome $1! RANDOM MSG }
  elseif ($nick == twitchnotify) && ( $4 isnum ) { describe $chan Wow! $1 Welcome $1! RANDOM MSG }  
}

_________________________
twitter @keyeslol

Top
#258364 - 27/06/16 05:45 PM Re: [Twitch] Important Change to Resub Notifications [Re: Bestpeff]
keyeslol Offline
Vogon poet

Registered: 15/05/15
Posts: 133
It works because you'll specify unique room-ids for the channels your bot is connected to. Room-id's are unique to each room.

We were talking about how to auto populate the room-id variable in the above code. However, the bots I've coded/managed do not do it this way. I've grabbed them once and set them.

Originally Posted By: Bestpeff
If the channel name is removed and automatically recognized....I don't understand how it'll work if your bot is connect to multiple Twitch partner's chat??
_________________________
twitter @keyeslol

Top
#258713 - 15/08/16 11:30 PM Re: [Twitch] Important Change to Resub Notifications [Re: keyeslol]
GoldenTaco Offline
Nutrimatic drinks dispenser

Registered: 08/06/16
Posts: 8
I know this section may have been forgotten and this may or may not be such a basic question, but whenever I add multiple messages to the script it doesn't come through, I use the $msg #chan Blah blah and it does make extra chat lines, help would be greatly appreciated. Thank you! laugh

Top