This is a Pokemon Showdown bot written in JavaScript for Node
This bot is based on commands and features, which are explained here. This is intended to ease bot configuration and customization, separating commands in multiple files, multiple features in different folders and merging functions in Global Objects like Bot, CommandParser or Settings. This bot also works in multiple languages at the same time, useful for language rooms.
Features included in this package:
- Base: Basic commands for getting basic information, manage command permissions, languages and dynamic commands (only-text commands useful for giving information).
- Chat-Plugins: This includes a customizable database of jokes and quotes, random answer and pokemon informational commands. This also includes a 'translate' command for pokemon stuff.
- Moderation: Automated chat moderation for infractions like spam, flood, caps, stretching, etc This also includes a blacklist and welcome messages called join-phrases.
- Battle: Automated battle bot for challenges, ladder and tournaments. This also includes teams management commands. Note that this is not an artificial intelligence, just an improvised algorithm that simulates in-game players (just for fun).
- Chat Logger: Stores logs of chat rooms and/or pms. This also includes an optional logs server.
- Tournaments: A single command for creating, starting and set auto-dq of a tournament automatically.
- Games: A collection of chat games for your Pokemon Showdown Bot
- Auto Invite: Automatically sends '/invite [room]' to room auth of a private room when they joins other room with a relation. For example if you have a secondary staff room and you want to get invited when you join lobby.
- Youtube link recognition: If this feature is enabled in a room, when an user send a youtube link, the bot send a message with the title of the video.
- Group Chats: Some tools for group chats (temporal rooms) suth as automated joining and automated roomauth promotion.
Pokémon Showdown Bot requires node.js to run. Install the last stable version if you do not have it.
The first step is cloning this repo, install Git if you have not it and use the following command on shell console:
$ git clone --branch=master git://github.com/Ecuacion/Pokemon-Showdown-Node-Bot.git Pokemon-Showdown-Node-Bot
You can also download a Zip of this repo and decompress it.
Then open a shell console, use cd
to reach the directory of the bot and install dependencies:
$ npm install --production
If you want to use npm test
for developement, install all dependencies with npm install
Now, to start the bot use:
$ node index.js
To configure your bot, copy config-example.js
to config.js
and edit that file. You can specify bot login credentials among other things. If you don't specify credentials, the bot will log in a random username started by 'Bot'. Read the Configuration Guide for more information
If you know all about Git you don't need to read this. This is just for people who want to make changes in their bots, but still want to keep them updated regarding this repo.
First, fork this repo. You can do it with the button Fork
Second, clone your repo in your computer, you can do it with GitHub desktop Client for Windows or Mac or with a shell console:
$ git clone <your own fork> <My-Bot-Example-Folder>
Third, create a remote to get the updates (first use cd
to reach the directory of your bot):
$ git remote add upstream https://github.com/Ecuacion/Pokemon-Showdown-Node-Bot.git
Now, you can make changes, and commit them.
When you want to update, you can follow these steps:
- Open a shell console and use
cd
to reach the directory of your bot - If you have uncommited changes use
git add --all
andgit commit -m "Your commit message"
- Use
git fetch upstream
to update your base version of Pokemon-Showdown-Node-Bot - Use
git checkout master
an thengit merge remotes/upstream/master
- If you get conflicts, solve them and use
git commit -a
- Once merged, your bot is updated
Check the configuration guide for more information.
Connection Details
Config.server
: Server url, for example main server url issim.smogon.com
Config.port
: Connection port, Pokemon Showdown default port is8000
Config.serverid
: Server id, main server id isshowdown
for exampleConfig.autoReconnectDelay
: If connection gets closed, how much time it is waiting before reconnectConfig.connectionTimeout
: If connection hang up, the time to check for reconnect
Crashguard
Config.crashguard
: If true, write errors to console instead of crashing
Watchconfig
Config.watchconfig
: If true, config.js is automatically reloaded when it is changed
Login Details
Config.nick
: Bot Nickname, if you don't specify a nickname, it will log in a random nicknameConfig.pass
: Password, if neededConfig.autoReloginDelay
: If it can't login because of server issues, how much time it is waiting before relogin
Rooms
Config.rooms
: Array of rooms to join after login. You can specify a string value:all
for joining all rooms,official
for official rooms andpublic
for not official roomsConfig.privateRooms
: Specify which rooms are privateConfig.initCmds
: Array of commands to send after login
Auth Config
Config.exceptions
: Specify rank exceptions. Useuserid: true
for full permissionsConfig.ranks
: Array of user groups ordered from lowest to highest authConfig.globalPermissions
: Global permissions that cannot be changed withset
Commands Config
Config.commandTokens
: Array of valid command characters. A command character, for example,.
means.command
usageConfig.defaultPermission
: Default permision set forthis.can
in commands permissionsConfig.permissionExceptions
: Exceptions for commands permissionsConfig.botguide
: Bot commands guide linkConfig.pmhelp
: Help message said when users pm the bot with no commandsConfig.ignoreRooms:
Room that will be ignored by CommandParser you you can use commands on those rooms. For example if you want to log the room without interfering with other bots commands.
Language Config
Config.language
: Set default language
Console Config
Config.debug
: Specify which console messages are shown
- Ecuacion (Owner)
Contributors:
- Freigeist (Languages/Translation feature and bug fixes)
- Irraquated (Languages and bug fixes)
- panpawn (YouTube feature, fixes)
- Spudling (German translation)
Part of this code is imported from other developments, so credits to:
- Quinella, Morfent and TalkTakesTime developers of Pokemon-Showdown-Bot
- Guangcong Luo and other contributors of Pokemon Showdown