[feature request] flag to allow a command to be called by a word in whole message

a little hard to imagine

but something like this
!addcom mf -pr=true $(user), you weren't supposed to say that word !!!!

where pr means presence
if set to true the command will be raised if “mf” exist in whole of message
that means
hey mf – should raise the command
hey mfsdsds — should not.

and while we are at it.
why not even add support for regex ?
I mean that would be a win win.
I hate when a command have to be called with proper capiltalization as most of input on mobile auto-capitalizes the first letter.

or make it case-insensitive. maybe even a flag ?

there are endless possibilities.

Hey @AG_1436!

Just a few notes:

No Nightbot commands have to be called with proper capitalization, you can call !test, !Test or !TEST and Nightbot will still answer if there’s a !test command. Maybe you meant parameters for a command, but that’s on the person who added the command to make sure their code is case-insensitive, Nightbot can’t do anything about this because of how JavaScript works.

Yes, you can disable that if you don’t like it, it’s in your keyboard settings.

yeah. that is additional step on average viewer end. which is less economical then just triggering the command.

No Nightbot commands have to be called with proper capitalization, you can call !test , !Test or !TEST and Nightbot will still answer if there’s a !test command.
I know how nightbot works. and i hate that it doesn’t auto correct a little slight of a mistake ?

Nightbot can’t do anything about this because of how JavaScript works.
maybe just do "Whtever the stuff is ".toLowerCase() . and compare it against the record. its not hard.

Am asking for change in the working of nightbot

if nightbot was open source. i would have just opened a Issue/PR.
am not asking questions. i am requesting change (stated in the title of thread)

I understand that, I’m just giving my feedback on your suggestions. Am I not allowed to do that?


It’s not as simple as you make it sound, parameters vary so much in nature we can’t realistically expect to impose everyone to use lowercase, some users might want to do something special with uppercase, for example:

!addcom hello $(eval const q = '$(query)'; q === 'mate' ? 'Hello mate!' : q === 'MATE' ? 'STOP YELLING!!!' : 'Hello!')

That’s why it falls on the person who writes the code to make it case-insensitive if they wish to.


I made this comment because that’d mean you’d have to teach Nightbot to recognize what should be compared in lowercase, what shouldn’t, etc. since JavaScript is a case-sensitive language, and far from being an AI.
Teaching Nightbot to recognize if the comparison should be made in lowercase or not can be essentially equated to a dev using .toLowerCase() in their code to tell JavaScript what to do with the data, so the solution is already there.

I understand that. that’s why i am asking for a “flag” as mentioned below.

you can make it default case insensitive. but when required make it case sensitive ?

the example you gave can be given a flag “case_sensitive=true” and it will care to pass the argument as exactly as they are. else we lower whole of the message in starting and send it to db/compare against db.

and that. that is the answer to the question. a feature request mainly aimed towards a change in the code. i think dev also read the forums ?.

Sorry, I missed your previous mention of a flag.

Yes, he does, no worries there, just gotta be a bit patient.

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