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


#2

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


#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.


#5

Good job. Once I liked this useful feature in WizeBot which was actively used by moderators, and it would be great if one day the developers will add it to PhantomBot.
The only reason I’m not using custom modules at the moment is that it leaves a bunch of garbage (stuck commands, settings, etc.) in phantombot.db after some possible changes in js code or full deletion.


#6

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


#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