WarnSys | Give user a warning without you to remember how many they have

release
commands
warning
phantombot
#1

forthebadge forthebadge forthebadge

The WarnSys, or long Warning System, is a simple script which allows you to give a user a warning for misbehavior and you don’t need to remember how many warnings he have.

The script timeout the User two times, first for 5 seconds and the second time for 600 seconds by default, and at least the third it will ban the User.

Installation

To install this script you simply need to download the latest release (click on the “release” image)

GitHub release

Folder View

and drop it in your PhantomBot folder /path/to/phatombot. Now restart the Bot and when you see this at the end of the startup the script is active:
Warn System Enabled

Usage

Its really simple!
First of all i need define two things:

  [] => Optional for command use
  () => Required for command use

The warn command

!warn (User) [Reason]

With this command you increase the warn level of the given user add ban/timout the user with the given reason.

Delete one warning

!delwarn (User)

With this command you decrease the warn level of the given user.

Clear the warnings

!delwarn (User) all

As it say it clear the warnings of the given User

Support, Bug etc.

GitHub issues

If you found something broken or a little or huge bug tell me here right away or open an Issue on GitHub.


GitHub license

4 Likes
WarnSys | Add warn reason to public message
#2

Fixed the wrong Release Link :sweat_smile: sorry for that.

1 Like
#3

Ok found an Bug my self :sweat_smile:
And i need a little help to solve it.
How can i check if the first char is an @ and if it is so how can i remove the first char from a string ?
Currently i use this helper function and it don’t work :confused:

 /**
  * @function userStrings
  * @param {string} user
  * @return {array}
  */
function userStrings(user) {
    var user_mention = "";
    var user_string = "";
    if (user.charAt(0) == "@"){
        user_mention = user;
        user_string = user.substr(1);
    } else {
        user_mention = "@" + user;
        user_string = user;
    }
    return [user_mention, user_string];
}

Thanks for the help :innocent:

Edit: Made an workaround with substring().

#4

v1.0.1 (HotFix) is out.

I fixed two bugs in this version.
The first bug was that i missed to remove a hard coded output.
The second one were that str.charAt() not worked properly so i reworked it with str.substring()

Thanks to @MatBuc who found the first bug.

Download Link in the start post.

#6

Really like this module/script hope it will be picked up as an default because this is great for small streamers

2 Likes
#7

Depending when the new Panel get released I will may create a interface part and if I figure out how, I will replace the fixed warn steps with a self configure one.

And then maybe I will do an PR to the Bot itself

#8
#9

Yeah simple description:
You need to add an argument to the command.

Long thing I can May do the next day.

But you want to define the reason with the command right ?

1 Like
#10

Yes thats correct

Bot: 1st warn: NAME this is your first warning! | Reason: customreason

PS
Sorry for this 10d late response.

#11

Ok this week I don’t have time.
Maybe I have a look on that next week.

#12

Appreciate it!
Thank you very much in advance for your time.

#13

Hi, i just installed your script and changed it to fit my needs, just one question, do i need to restrict the commands to be used only by mods or is that hardcoded already?

/edit
just found it myself, dont mind me :smiley:

1 Like
#14

Oh Yeah is hard coded i should das the command with settings to the command permissions if I not already have :sweat_smile: