You can find the
$msgtags that are available to be used by reading the RAW data when someone gifts a sub to someone else. Here are the
newer ones that I've noticed when it's a sub gift in channel:
^ This will match "
subgift" if the notice is a gifted sub in the channel.
$msgtags(msg-param-recipient-display-name).key
^ This is the Twitch DisplayName of the recipient of the gifted sub.
$msgtags(msg-param-recipient-id).key
^ This is the Twitch UserID of the recipient of the gifted sub.
$msgtags(msg-param-recipient-user-name).key
^ This is the username of the recipient of the gifted sub (all lowercase name).
Based on this info, I did a quick edit to your script. As mentioned by maroon, the "
$0 == 1" doesn't really make sense in your script, and it actually looks unnecessary to me.
raw USERNOTICE:*:{
if (($msgtags(msg-id).key == subgift) && ($1 == #channel)) {
var %nick_from $iif($msgtags(display-name).key, $v1, $msgtags(login).key) , %nick_to $iif($msgtags(msg-param-recipient-display-name).key, $v1, $msgtags(msg-param-recipient-user-name).key)
msg $1 Thank you %nick_to for subscribing with a gifted sub from %nick_from <3
}
}