Miss any of our Open RFC calls?Watch the recordings here! »

tennu-admin

5.0.0 • Public • Published

Admin Plugin for Tennu

Travis Status NPM Downloads Version ISC Licensed Github Issue Count Github Stars

Gives administrative control to a Tennu bot.

Depends on Tennu 4.7.0 or higher.

This plugin implements the 'admin' role. This role is deprecated.

Installation

npm install tennu-admin

Config

  • "admins" : The list of admins allowed to use admin commands.
  • "admin-commands" : List of commands that require admin privileges.
  • "admin-failed-attempt-response" : Response returned when access to command is rejected.
{
    "admin-commands": [
        "roll"
    ],
    "admins": [
        {
            "nickname": "^name$",
            "username": "^name$",
            "hostname": "^your\.hostmask\.isp\.net$",
            "identifiedas": "accountname"
        }
    ],
    "admin-failed-attempt-response": "You aren't allowed to use this command."
}

The admin-commands list is a list of commands that you want to only be used by admins. Some plugins require the admin plugin. For those, the author has decided that it is better to always require admin control for those commands.

The nickname, username, and hostname fields of admin objects will be coverted to case-insensitive regular expressions.

A person is considered an admin of the bot if all set properties on one of the admin objects are true. In general, you should just have identifiedas properties for your admins. Though using just nickname on Twitch also works.

Example:

    "admins": [
        {nickname: "^havvy$", username: "^havvy$", identifiedas: "havvy"},
        {identifiedas: "botmaster"}
    ]

This bot will accept as admins anybody who is havvy!havvy@* and identified to the account 'havvy', along with anybody identified to the account 'botmaster'.

Note: On some networks, the user will only be identified to the account while their nickname is the accountname being checked.

Exports

isAdmin(hostmask: Hostmask): boolean

Determines whether the user is an admin.

requireAdmin(fn: Function): Function

Wraps a function making it require admin priviledges to use.

For example, see tennu-control.

Install

npm i tennu-admin

DownloadsWeekly Downloads

1

Version

5.0.0

License

ISC

Last publish

Collaborators

  • avatar