Bot commands duplicated across multiple streams

Hi all

I’m new to the world of bots and coding and have stumbled across my first problem!

I’m currently making a Twitch bot.

I have my bot set to work across two Twitch channels currently, and have a command - for example !discord

My code looks like this:

if(message.toLowerCase() === ‘!discord’) {
client.say(channel=CHANNEL_NAME, DISCORD_LINK);

I have two pieces of code that look like this, with the discord link differing depending on the channel that the command is run in.

I have added “=CHANNEL_NAME” onto channel, which isolates the command to that stream. However, if I run the !discord command in one channel, it automatically runs the !discord command in the other channel.

Is there a way to isolate commands to just one channel, whilst having the option for multiple channels to use the bot?

I hope this all makes sense :slight_smile:

Thanks so much

Can you send me your code?

Thanks so much for your reply and apologies for the delay in my response.

I’ve been away from this for a little while, though remember trying the code and was unfortunately still having some issues with it.

Once I have a moment to delve back into this I will give it another try :slight_smile:

Thanks again!

Katie

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