Twitch shoutout command in Discord

Here is the command:

Check out the wonderful $(touser) and drop a follow at: $(twitch $(eval decodeURIComponent($(querystring)).replace(/@/g,``)) “{{url}}”)

The return is correct up until it should give me a Twitch Channel.

I have Twitch and Discord linked, have the connection linked on my user settings. !title is the only command I seem to be able to get Twitch data back from properly.

What am I doing wrong here?

Hey @klausethecombustible!

If I understand well what you’re trying to do, this is the answer you’re looking for:

I should also add that I’m trying to trigger this in Discord, since that might matter?

That being said, I just tried that, and got the same unknown twitch channel output.

Oh, so you want to be able shoutout Twitch channels from your Discord server?.. That would have been useful to specify it in advance, haha!

So, having a few Discord bots in development, I don’t think it’s possible to do it with Nightbot, as when you mention someone, you see @USERNAME, but in the client it’s @USERNAME_ID, which is very different.
When you call the command from Discord you feed Nightbot a bunch of numbers to look at as a channel, so of course it won’t find it and return the Unknown Twitch Channel error.
Moreover, it’s not uncommon to have people with different usernames on Twitch and Discord, so this wouldn’t work in these cases either.
For it to work all the time you’d have to fetch the Twitch account they linked to their Discord, and I don’t think Nightbot can do that.

But I can be wrong, I’m not familiar enough with Nightbot’s Discord integration, @night will be able to inform you once he checks the forum and confirm/dismiss what I said.

I was pretty worn out when I wrote the post, otherwise I might have remembered to mention that :slight_smile: I apologize!

I thought perhaps the bot was looking something up in the integration, that would require linked Twitch and Discord accounts.

Thank you very much for the help though, and sorry it was a kinda wasted question :smiley:

It’s alright, it’s an interesting question imo.
I guess a way to make it work in Discord would be to not use @mentions but to type the Twitch username entirely.

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