# The broadcaster cant use the commands only mods can

**URL:** <https://discuss.dev.twitch.com/t/the-broadcaster-cant-use-the-commands-only-mods-can/38225>\
**Category:** Chat and IRC\
**Created:** [May 2, 2022, 2:54pm UTC](https://discuss.dev.twitch.com/t/the-broadcaster-cant-use-the-commands-only-mods-can/38225 "2022-05-02T14:54:17Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![FreakSheep](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/freaksheep/32/17992_2.png) [@FreakSheep](https://discuss.dev.twitch.com/u/FreakSheep)\
**Post date:** [May 2, 2022, 2:54pm UTC](https://discuss.dev.twitch.com/t/the-broadcaster-cant-use-the-commands-only-mods-can/38225/1 "2022-05-02T14:54:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [May 2, 2022, 2:56pm UTC](https://discuss.dev.twitch.com/t/the-broadcaster-cant-use-the-commands-only-mods-can/38225/2 "2022-05-02T14:56:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![FreakSheep](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/freaksheep/32/17992_2.png) [@FreakSheep](https://discuss.dev.twitch.com/u/FreakSheep)\
**Post date:** [May 2, 2022, 3:04pm UTC](https://discuss.dev.twitch.com/t/the-broadcaster-cant-use-the-commands-only-mods-can/38225/3 "2022-05-02T15:04:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [May 2, 2022, 3:06pm UTC](https://discuss.dev.twitch.com/t/the-broadcaster-cant-use-the-commands-only-mods-can/38225/4 "2022-05-02T15:06:21Z")

</div>

> [@FreakSheep](#):
>
> and yes i do use java

java or javascript? Two tottaly different languages.

> [@FreakSheep](#):
>
> client.on(‘chat’, (channel, user, message, self) =\> {

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

---

<div class="post-metadata">

**Author:** ![FreakSheep](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/freaksheep/32/17992_2.png) [@FreakSheep](https://discuss.dev.twitch.com/u/FreakSheep)\
**Post date:** [May 2, 2022, 3:07pm UTC](https://discuss.dev.twitch.com/t/the-broadcaster-cant-use-the-commands-only-mods-can/38225/5 "2022-05-02T15:07:39Z")

</div>

ow sorry yea ment JavaScript

---

<div class="post-metadata">

**Author:** ![FreakSheep](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/freaksheep/32/17992_2.png) [@FreakSheep](https://discuss.dev.twitch.com/u/FreakSheep)\
**Post date:** [May 2, 2022, 3:09pm UTC](https://discuss.dev.twitch.com/t/the-broadcaster-cant-use-the-commands-only-mods-can/38225/6 "2022-05-02T15:09:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [May 2, 2022, 3:12pm UTC](https://discuss.dev.twitch.com/t/the-broadcaster-cant-use-the-commands-only-mods-can/38225/7 "2022-05-02T15:12:52Z")

</div>

Plain Javascript or “for this library”?

if the latter which library.

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

---

<div class="post-metadata">

**Author:** ![FreakSheep](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/freaksheep/32/17992_2.png) [@FreakSheep](https://discuss.dev.twitch.com/u/FreakSheep)\
**Post date:** [May 2, 2022, 3:14pm UTC](https://discuss.dev.twitch.com/t/the-broadcaster-cant-use-the-commands-only-mods-can/38225/8 "2022-05-02T15:14:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://d2opxh93rbxzdn.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://discuss.dev.twitch.com/u/system)\
**Post date:** [June 1, 2022, 3:14pm UTC](https://discuss.dev.twitch.com/t/the-broadcaster-cant-use-the-commands-only-mods-can/38225/9 "2022-06-01T15:14:58Z")

</div>

Closed on June 1, 2022, 3:14pm UTC

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