The broadcaster cant use the commands only mods can

Hello
i have a small issue
i made a follower only mode on and off command but somehow only the moderators can use it and the broadcaster cant any idea what is did wrong ?

Here is one of the codes:

client.on(‘chat’, (channel, user, message, self) => {
if (self) return;
let sender = user[‘display-name’]
if (message.startsWith("!FD") && user.mod, user.broadcaster === true){
client.say(process.env.CHANNEL_TOKEN, “/followersoff”);
}
});

Thank you in advance

This suggests that user.broadcaster is not true.
Or user doesn’t contain what it is supposed to contain
Or user is derived from tags and is using the deprecated broadcaster tag instead of testing badges
Or user is derived from tags and is malfunctioning.

But in this case why would a mod or a broadcaster user a bot command when they can just do /followersoff themself. Basically doesn’t make sense to ask the caster or a mod to sue a bot command when the caster or a mod can do it themself. You have needless reimlemented a channel command.

So either fix how your user is generated or if you are using a library (which you didn’t declare so I’m assuming plain javascript, but you didn’t declare your language either) refer to that libraries documentation.

yea i kow but whanted to make it even easyer for my mods and hardcoded the timer

but have the same problem with my raid command

and yes i do use java

java or javascript? Two tottaly different languages.

debug/log out user

And see what it has to allow you to see if the user is the broadcaster

Usual methoids

  • does the username == the room name
  • does the user have the broadcaster badge

ow sorry yea ment JavaScript

got any snippets on how to add this sorry its my first time using that

Plain Javascript or “for this library”?

if the latter which library.

if the former, depends on what your message parser looks like.

ill let you know in a minute got a program engineer looking at it atm