InstaSynchP Commands

Plugin for custom commands

ავტორი
Zod-
დღიური ინსტალაციები
0
მთლიანი ინსტალაციები
33
რეიტინგი
0 0 0
ვერსია
1.0.3
შექმნილია
08.11.2014
განახლებულია
29.04.2015
ლიცენზია
MIT
გამოყენებს მათ

InstaSynchP-Commands

Plugin for custom commands

Framework

The commands object can be used to bind custom commands, grab information and execute them. Commands will be queued so the user doesn't get disconneted for flood detection. Every 1 second 4 commands will be sent.

The core will automatically load commands from this.commands when it loads e.g.:

this.commands = {
    "'command": {
        'hasArguments': true,
        'type': 'mod',
        'reference': this,
        'description': 'description',
        'callback': this.execute
    }
};

The first argument of the callback function will be an object of some pre parsed arguments:

opts = {
    usernames: [], //arguments that will fit the username regex
    videos: [], //arguments that could be parsed with the urlParser
    numbers: [] //arguments that are numbers
}

commands.bind

commands.bind({
    "'command": {
        'hasArguments': true,
        'type': 'mod',
        'reference': this,
        'description': 'description',
        'callback': function(){
            //logic
        }
    }
});

Commands with hasArguments: true will be instantly sent to chat when using autocomplete and type: mod commands will only show up when you are a mod.

commands.get

commands.get("'command");

commands.getAll

commands.getAll();

commands.execute

commands.execute("'command", 'arg1', 'arg2');

Public Variables

  • commands.commandMap containing all the bound commands
  • commands.commandQueue queue containing the to be sent commands

License

The MIT License (MIT)

<InstaSynch - Watch Videos with friends.>
Copyright (c) 2014 InstaSynch

<Bibbytube - Modified InstaSynch client code>
Copyright (C) 2014 Zod-

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.