Installation

Nikoro is written in Node.js, so you'll need to download and install it together with npm. Take care to install Node.js 6.0 or higher.

Clone the repository to your computer and run the setup wizard:

git clone https://github.com/Telegram-Bot-Node/Nikoro
cd Nikoro
npm run setup:guided

The wizard will ask for the bot token, which you can get from @BotFather, and then take control of the bot.

The command-line wizard.
The list of plugins in the bot wizard.
Plugin selection in the bot wizard.

When you're done, just send /done to quit the wizard, and you're ready to launch the bot:

npm start bot
info: [Bot] Nikoro version 1.0.0, commit 72567d9
info: [Bot] Instance created.
info: [Bot] Plugins loaded.
info: [Bot] The bot is online!

Plugins

User's guide features many plugins for different use cases, from moderation tools to word games. Here are some highlights:

Moderation
Kick
Provides basic kick/ban functionality.
ModTools
Implements warnings, banned words and reporting features.
Antiflood
Stops floods by ignoring, warning or kicking users.
Ignore
Prevents users from interacting with the bot.
Fun
Markov
Sends random messages by learning from yours.
Wordgame
Test your typing speed, or your ability to solve anagrams.
Karma
Keeps scores about users.
Utility
Set/MediaSet
Replies to triggers with a configurable message, image, video...
Reminder
Reminds you of upcoming events.
Quote
Can save quotes and browse them.
Vote
Lets users vote on questions.
RegexSet
Like Set, but accepts regular expressions.
Spoiler
Hides spoilers with a button.

Expert setup

Nikoro can also be configured via a command line interface, which provides more control and can be faster than the Telegram-based process. The command-line setup can be invoked with:

npm run setup:expert

This will install the dependencies and start the setup interface. The first prompt asks for the bot token, which you can get from @BotFather.

npm run setup:expert
> telegram-bot-node@1.0.0 setup:expert /tmp/Nikoro
> bash bin/expert-install.sh

Checking for Node.js...
Node.js found.
Checking for npm...
npm found.
Installing dependencies...

added 371 packages in 5.646s
Dependencies installed.

> Nikoro@1.0.0 configure:expert /tmp/Nikoro
> node src/Installer.js

? What's the bot token?

Then, you will select the plugins from a list. You can browse the list with the arrow keys, and select individual plugins with Space.

? What plugins would you like to enable? (Press <space> to select, <a> to toggle all, <i> to inverse selection)
❯◯  The8Ball - Magic 8-Ball!
 ◯  Antiflood - Automatically ignore or kick spamming users
 ◯  Auth - Plugin to handle authentication
 ◯  BoobsButts - Get boobs and butts.
 ◯  Config - Configuration manager
 ◯  Echo - Totally not a bot with an echo
 ◯  Porn - Searches porn.com.
Some plugins may be disabled because they couldn't be initialized:
-  YouTube.js (Cannot find module 'youtube-api')

The most common error is "Cannot find module 'x'", which means that you simply need to open a new terminal, navigate to the bot's directory, and install the module. For example, to use the plugin YouTube.js you would need to run the commands below, and then restart the setup:

cd Nikoro
npm install youtube-api

Then, you will be asked for the list of administrators. The prompt specifically asks for an array of user IDs surrounded by square braces. Getting your user ID can be difficult; you can get it from an existing Nikoro installation using the UserInfo plugin, or by console.log-ging incoming messages in a node-telegram-bot-api instance, or from your profile page in Plus Messenger.

? Enter the list of global admins as an array of user IDs (eg. [1111, 1234])

Finally, you can select the logging level.

  • "Error" logs only errors (fatal or not).
  • "Warn" reduces logging to warnings you should be aware of;
  • "Info" is recommended for normal usage;
  • "Verbose" is a bit more moderate;
  • "Debug" prints an insane amount of information;
? What logging level is to be used?
  error
  warn
❯ info
  verbose
  debug

Manual setup

Both setup processes are a graphical frontend to create the configuration file; however, nothing stops you from creating your own. Here are the specifications:

  • Settings are stored in a JSON file called config.json in the root folder of the project.
  • The root element is an object with the following properties (case-sensitive):
    • TELEGRAM_TOKEN (string): the bot token
    • activePlugins (array of strings): the list of plugins, as an array of file names without ".js" (eg. ["Set", "MediaSet", "Wordgame"])
    • globalAdmins (array of numbers): the list of user IDs that start as "global admins" (i.e. have maximum powers in every chat)
    • loggingLevel (string): one of "error", "warn", "info", "verbose" or "debug"