So i’ve seen on other channels mods are able to for example type !hours @user which returns @user streamer has 4000 hours in X game, but when typing just !hours on its own it tags no one including not tagging the person that typed the command.
What code would i need to set this up? i know to use !addcom !hours $(touser) streamer has 4000 hours in x game … but doing it this way tags the command typer if no tag is added.
Thanks, the only trouble with that is people can abuse it and make nightbot say things that can’t be moderated … unless its possible to make the $(query) part of the command mod only?
is it possible to change the query part so it will only ever show the first word after the typed command? just so i can avoid something like !test @user blah blah blah from happening and making nightbot returning the whole sentence rather than just the users tag?
just did abit of testing with the code and ran into abit of a problem, it made the whole command mod only… really i need the command to be available to all users but the query part of it to be mod only… so any user can still type !test and the command works but only mods can tag users within the nightbot return.
Looking back to your first message, you want a command called !hours that, when used by a mod with a specified user, goes:
@user Streamer has 4000 hours in X game.
All you have to do is put that message after the $(eval) variable am_1 set up for you:
!addcom -cd=5 !hours $(eval d=decodeURIComponent;["owner","moderator"].includes(d("$(querystring $(userlevel))"))?(d("$(querystring)").split(" ")[0]||" "):" ") Streamer has 4000 hours in X game.
Side note: the -cd=5 part makes the command cooldown 5 seconds. You may either change it to any other value between 5 and 300 or leave it out altogether, in which case it’ll default to 30 seconds.