Java script to stop bot from sending message

Asked Jun 26, 2021·5 replies·Last activity 5 years ago·Open in Discord ↗
Archived from the original community forum
Things may have changed since it was written. Still stuck? Ask the community on Discord.

Hi.
i want to stop bot from responding to me on my channel..Could you please help me with a java script code for the same

5 replies

@Coral Owl If you want Nighbot not to send message, then just Part Channel, Nightbot will disconnect and, ready to go. It can be done something like this:

$(eval '$(channel)' === 'CHANNEL_NAME' ? ' ': 'I am responding cause this is not $(channel)')

I guess. Uff

i dont want to part from the channel..i just dont want it to reply to me when i send a text that triggers the command.. i want it to reply to others on the chat only.

@Coral Owl Well... You need to modify the commands.

$(eval "$(user)" === "YOU_USER_NAME" ? " " : "COMMAND_RESPONSE_HERE")

Suppose a normal !hi command.

!editcom -cd=5 !hi $(eval "$(user)" === "Ritik_Ranjan" ? " " : "Hi $(user)")

It should work something like this:

Ritik: !hi
ABC: !hi
Nighbot: Hi ABC

Regards

I have already tried this, night bot still sends a blank message

image.png

This solution would work on Twitch due to the inability to post just a space as a message. However this restriction doesn't exist on Youtube gaming as you can see.

I was able to create a message that couldn't send with a Zero Width Space, so you're response can just return one. Easy Copy Paste Link

Something like this:

$(eval "$(user)" === "aaron128l" ? "​" : "COMMAND_RESPONSE_HERE")

Yes there is a space in between "" you can tell if you copy and paste it and try to navigate with your arrow keys.

image.png

Didn't find your answer? The community is on Discord.

Ask on Discord