mIRC Homepage

[Twitch] Re-Sub Help

Posted By: ItsWZRDx

[Twitch] Re-Sub Help - 02/07/16 02:11 AM

I was using this for Resubs Notifications and it stopped working with the new update, any help?

Here is the code:

on 1:connect: { raw CAP REQ :twitch.tv/membership }

on 1:text:*subscribed*:#CHANNELID:{
if ( $nick == twitchnotify ) && ($istok($1-,subscribed to,32)) halt
elseif ($nick == twitchnotify) && ( $4 == $null ) { describe $chan Welcome to the # $1! }
elseif ($nick == twitchnotify) && ( $4 isnum ) { describe $chan $1 has subscribed for $4 months in a row! }
}
Posted By: Khonor

Re: [Twitch] Re-Sub Help - 02/07/16 03:14 AM

Hey @ItsWZRDx,


Try using this code:

Quote:
on *:LOGON:*:{
raw CAP REQ :twitch.tv/membership
raw CAP REQ :twitch.tv/tags
raw CAP REQ :twitch.tv/commands
/debug @raw
}

on 1:TEXT:*subscribed*:#[CHANNEL NAME HERE]:{
if ( $nick == twitchnotify ) && ($istok($1-,subscribed to,32)) halt
elseif ($nick == twitchnotify) && ( $4 == $null ) { describe $chan Welcome to the # $1 $+ ! }
}


raw USERNOTICE:*:{
if (($msgtags(msg-id).key == resub) && ($1 == #[CHANNEL NAME HERE])) {
var %nick $iif($msgtags(display-name).key, $v1, $msgtags(login).key)
if ($0 == 1) {
describe $1 %nick has been subbed for $msgtags(msg-param-months).key months in a row!
}
else {
describe $1 %nick has been subbed for $msgtags(msg-param-months).key months in a row with the message: $qt($2-)
}
}
}
Posted By: ItsWZRDx

Re: [Twitch] Re-Sub Help - 02/07/16 03:43 AM

Thank you @Khonor

I am going to try that in the stream for tonight and I will report back if I have any issues.
Posted By: ItsWZRDx

Re: [Twitch] Re-Sub Help - 02/07/16 04:21 AM

I used this code and it didn't work for the resubs, let me know if I did anything wrong. [It did work for the new subs though]

on *:LOGON:*:{
raw CAP REQ :twitch.tv/membership
raw CAP REQ :twitch.tv/tags
raw CAP REQ :twitch.tv/commands
/debug @raw
}

on 1:TEXT:*subscribed*:#[nickmercs]:{
if ( $nick == twitchnotify ) && ($istok($1-,subscribed to,32)) halt
elseif ($nick == twitchnotify) && ( $4 == $null ) { describe $chan nickmercsSH Welcome to the #MercsFam $1 nickmercsLOVE nickmercsLY $+ ! }
}


raw USERNOTICE:*:{
if (($msgtags(msg-id).key == resub) && ($1 == #[nickmercs])) {
var %nick $iif($msgtags(display-name).key, $v1, $msgtags(login).key)
if ($0 == 1) {
describe $1 nickmercsSH %nick has been subbed for $msgtags(msg-param-months).key months in a row! nickmercsLOVE nickmercsLY
}
else {
describe $1 nickmercsSH %nick has been subbed for $msgtags(msg-param-months).key months in a row with the message: $qt($2-) nickmercsLOVE nickmercsLY
}
}
}
Posted By: Khonor

Re: [Twitch] Re-Sub Help - 02/07/16 04:26 AM

Remember in the "#ChannelName" is not going this "[ ]" or the bot will not respond you.

Quote:
on *:LOGON:*:{
raw CAP REQ :twitch.tv/membership
raw CAP REQ :twitch.tv/tags
raw CAP REQ :twitch.tv/commands
/debug @raw
}

on 1:TEXT:*subscribed*:#nickmercs:{
if ( $nick == twitchnotify ) && ($istok($1-,subscribed to,32)) halt
elseif ($nick == twitchnotify) && ( $4 == $null ) { describe $chan nickmercsSH Welcome to the #MercsFam $1 nickmercsLOVE nickmercsLY $+ ! }
}


raw USERNOTICE:*:{
if (($msgtags(msg-id).key == resub) && ($1 == #nickmercs)) {
var %nick $iif($msgtags(display-name).key, $v1, $msgtags(login).key)
if ($0 == 1) {
describe $1 nickmercsSH %nick has been subbed for $msgtags(msg-param-months).key months in a row! nickmercsLOVE nickmercsLY
}
else {
describe $1 nickmercsSH %nick has been subbed for $msgtags(msg-param-months).key months in a row with the message: $qt($2-) nickmercsLOVE nickmercsLY
}
}
}
Posted By: ItsWZRDx

Re: [Twitch] Re-Sub Help - 02/07/16 04:36 AM

It works, thanks for all the help! <3
Posted By: Khonor

Re: [Twitch] Re-Sub Help - 02/07/16 04:40 AM

You're welcome @ItsWZRDx a pleasure to help you! smile
Posted By: Scootycoolguy

Re: [Twitch] Re-Sub Help - 22/07/16 06:12 PM

I am having problems with the 2nd part of the re-sub notification code not working when a user types a message. It works on new subs and re-subs without a message, but doesn't work once they add that message.
© 2021 mIRC Discussion Forums