How to make a nightbot shoutout command that ignores the @ in a username

So, I’ve seen it in other streams, where someone has a command that is like !so @USERNAME_HERE and it will link to a twitch channel that excludes the @ symbol. A channel I mod for has a !so command, but we have to go back and erase the @, or carefully spell sometimes difficult usernames out. Does anyone know how to help me out?

This !so command should remove the @ if there is one as well as output the name normally if there is no @

!addcom -cd=5 !so $(twitch $(eval a=decodeURIComponent(`$(querystring)`);a.charAt(0)==`@`?a.slice(1):a) "Go check out {{displayName}} playing {{game}} at {{url}}")

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