Grand Ant said:
oh i forgot to write the channel name, sorry.
You don't need to write the channel name, $(channel) replaces the field automatically.
Grand Ant said:
now it says “Nightbot: Missing } in template expression”
The error you get means that you deleted something that shouldn't have been deleted.
Grand Ant said:
nightbot response is "The current active moderators are: ". Like it doesnt say anything, its just blank
If the list of active moderators is empty, except for bots we filter out, then the response will give no name. Active moderators means moderators that are currently actively watching the stream and/or talking in the chat. If the stream isn't live there's low chances you'll get any mod listed.
And finally, note that the Twitch API regarding the active chatters isn't live, it's refreshed periodically, so sometimes you'll have to wait for a bit to get the name of an active mod in the list.
If however, you want the full mods list, regardless of how active they are, just do /mods.
That being said, this is the command to filter out both Nightbot and Streamelements from the active mods list:
!addcom !mods $(eval mods=$(urlfetch json https://tmi.twitch.tv/group/user/$(channel)/chatters).chatters.moderators;bots=[`Nightbot`,`Streamelements`];bots.forEach(b=>mods=mods.filter(m=>m.toLowerCase()!=b.toLowerCase()));`The current active moderators are: ${mods.join(`, `)}`;)