{"_id":"@asanrom/ps-bot-lib","_rev":"6-f4d407af4aeef927aa5dd11756406bdb","name":"@asanrom/ps-bot-lib","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@asanrom/ps-bot-lib","version":"1.0.0","author":{"url":"https://github.com/AgustinSRG","name":"Agustin San Roman","email":"agustinsanromanguzman@gmail.com"},"license":"MIT","_id":"@asanrom/ps-bot-lib@1.0.0","maintainers":[{"name":"asanrom","email":"agustinsanromanguzman@gmail.com"}],"homepage":"https://github.com/AgustinSRG/ps-bot-lib","bugs":{"url":"https://github.com/AgustinSRG/ps-bot-lib/issues"},"dist":{"shasum":"83fa715d205206709f72e2e7b9e32e3a68a40558","tarball":"https://registry.npmjs.org/@asanrom/ps-bot-lib/-/ps-bot-lib-1.0.0.tgz","fileCount":15,"integrity":"sha512-/C9bZI/Gl2xLfjC8jzp4Du7+ukmgLOde76bokgwruayNMilTuCpPcvYpZ0dqYq5FyU1vfS5DgGfFd4IrZjjemQ==","signatures":[{"sig":"MEYCIQDip0I/K3CrJQhjubHDVV4CcJzUiPprA73CrmgppOUK/gIhANooKNwj6glAkYoqsqU7wNFlftYN99ASbCiXAimlYu2U","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49211},"main":"dist/index.js","engines":{"node":">= 18.0.0"},"gitHead":"5c6de89f9b43dec794f038da0299d22d214dd1ba","scripts":{"lint":"eslint --fix src/**/*.ts","test":"env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha --bail -r ts-node/register 'tests/**/*.ts'","build":"rimraf dist && npm run compile","gendoc":"typedoc --out docs ./src","compile":"tsc --pretty --declaration","prebuild":"npm run lint"},"typings":"dist/index.d.ts","_npmUser":{"name":"asanrom","email":"agustinsanromanguzman@gmail.com"},"pre-commit":["lint"],"repository":{"url":"git+https://github.com/AgustinSRG/ps-bot-lib.git","type":"git"},"_npmVersion":"8.5.5","description":"Simple library to create bots for Pokemon Showdown","directories":{},"_nodeVersion":"18.14.2","dependencies":{"sockjs-client":"1.6.1"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"10.2.0","eslint":"8.37.0","rimraf":"4.4.1","ts-node":"10.9.1","typedoc":"0.24.6","typescript":"5.0.3","@types/node":"18.15.11","@types/mocha":"10.0.1","@types/sockjs-client":"1.5.1","@typescript-eslint/parser":"5.57.1","@typescript-eslint/eslint-plugin":"5.57.1"},"_npmOperationalInternal":{"tmp":"tmp/ps-bot-lib_1.0.0_1693054942132_0.36356372306074425","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@asanrom/ps-bot-lib","version":"1.0.1","author":{"url":"https://github.com/AgustinSRG","name":"Agustin San Roman","email":"agustinsanromanguzman@gmail.com"},"license":"MIT","_id":"@asanrom/ps-bot-lib@1.0.1","maintainers":[{"name":"asanrom","email":"agustinsanromanguzman@gmail.com"}],"homepage":"https://github.com/AgustinSRG/ps-bot-lib","bugs":{"url":"https://github.com/AgustinSRG/ps-bot-lib/issues"},"dist":{"shasum":"d68dbc1d51313f48f84bb2969ffc7590294bb28c","tarball":"https://registry.npmjs.org/@asanrom/ps-bot-lib/-/ps-bot-lib-1.0.1.tgz","fileCount":15,"integrity":"sha512-kfh8cZwO3KE3nieAVhW6n9d5iUKJpio+9HBk6H5LhdKaJeZacBiRfl25c1/7YAmJa67g3kz2E182gFhF98r+tQ==","signatures":[{"sig":"MEUCIQCciw4IipqkmlHcH6V7F2LGpWXsQe7illmdYfERAMM02QIgGT4oCXSqyh0w1vMRGonXsLToT5YeOiWb6R+IbzXzAC8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49214},"main":"dist/index.js","engines":{"node":">= 18.0.0"},"gitHead":"56d4bd417cb04332bafb5f303c0300d0d79b3448","scripts":{"lint":"eslint --fix src/**/*.ts","test":"env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha --bail -r ts-node/register 'tests/**/*.ts'","build":"rimraf dist && npm run compile","gendoc":"typedoc --out docs ./src","compile":"tsc --pretty --declaration","prebuild":"npm run lint"},"typings":"dist/index.d.ts","_npmUser":{"name":"asanrom","email":"agustinsanromanguzman@gmail.com"},"pre-commit":["lint"],"repository":{"url":"git+https://github.com/AgustinSRG/ps-bot-lib.git","type":"git"},"_npmVersion":"8.5.5","description":"Simple library to create bots for Pokemon Showdown","directories":{},"_nodeVersion":"20.11.0","dependencies":{"sockjs-client":"1.6.1"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"10.2.0","eslint":"8.37.0","rimraf":"4.4.1","ts-node":"10.9.1","typedoc":"0.24.6","typescript":"5.0.3","@types/node":"18.15.11","@types/mocha":"10.0.1","@types/sockjs-client":"1.5.1","@typescript-eslint/parser":"5.57.1","@typescript-eslint/eslint-plugin":"5.57.1"},"_npmOperationalInternal":{"tmp":"tmp/ps-bot-lib_1.0.1_1713974652109_0.2176078439890612","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@asanrom/ps-bot-lib","version":"1.0.2","author":{"url":"https://github.com/AgustinSRG","name":"Agustin San Roman","email":"agustinsanromanguzman@gmail.com"},"license":"MIT","_id":"@asanrom/ps-bot-lib@1.0.2","maintainers":[{"name":"asanrom","email":"agustinsanromanguzman@gmail.com"}],"homepage":"https://github.com/AgustinSRG/ps-bot-lib","bugs":{"url":"https://github.com/AgustinSRG/ps-bot-lib/issues"},"dist":{"shasum":"abcfbc7d4b8a582057e4702c2f7d65d68544fac5","tarball":"https://registry.npmjs.org/@asanrom/ps-bot-lib/-/ps-bot-lib-1.0.2.tgz","fileCount":15,"integrity":"sha512-X4/oRbMQms3CZPIRX2Z7tN8VSuFUcKz6BMzNBhG3hl9rMgBUfMwOBTWBAl2MObjXY+T7QAcSMjuz17HCfI0FmA==","signatures":[{"sig":"MEYCIQDB1zDi8ubYFjqrxw9yCepZ7RjHzOYqxYlyteGJT4hS/AIhAN0BUgXb45otZIzSkQBD1JVro5Kuid+m8akxfyyyp7zB","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":48514},"main":"dist/index.js","engines":{"node":">= 18.0.0"},"gitHead":"b49ba318b13f85f34a6a2f6171c5d3e6f474418b","scripts":{"lint":"eslint --fix src/**/*.ts","test":"env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha --bail -r ts-node/register 'tests/**/*.ts'","build":"rimraf dist && npm run compile","gendoc":"typedoc --out docs ./src","compile":"tsc --pretty --declaration","prebuild":"npm run lint"},"typings":"dist/index.d.ts","_npmUser":{"name":"asanrom","email":"agustinsanromanguzman@gmail.com"},"pre-commit":["lint"],"repository":{"url":"git+https://github.com/AgustinSRG/ps-bot-lib.git","type":"git"},"_npmVersion":"8.5.5","description":"Simple library to create bots for Pokemon Showdown","directories":{},"_nodeVersion":"20.11.0","dependencies":{"sockjs-client":"1.6.1"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"11.1.0","eslint":"8.37.0","rimraf":"4.4.1","ts-node":"10.9.1","typedoc":"0.24.6","typescript":"5.0.3","@types/node":"18.15.11","@types/mocha":"10.0.1","@types/sockjs-client":"1.5.1","@typescript-eslint/parser":"5.57.1","@typescript-eslint/eslint-plugin":"5.57.1"},"_npmOperationalInternal":{"tmp":"tmp/ps-bot-lib_1.0.2_1739617108925_0.2908480279788248","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@asanrom/ps-bot-lib","version":"1.0.3","author":{"url":"https://github.com/AgustinSRG","name":"Agustin San Roman","email":"agustinsanromanguzman@gmail.com"},"license":"MIT","_id":"@asanrom/ps-bot-lib@1.0.3","maintainers":[{"name":"asanrom","email":"agustinsanromanguzman@gmail.com"}],"homepage":"https://github.com/AgustinSRG/ps-bot-lib","bugs":{"url":"https://github.com/AgustinSRG/ps-bot-lib/issues"},"dist":{"shasum":"587e0e60a3154cf2f96f6dfea133453df495e54d","tarball":"https://registry.npmjs.org/@asanrom/ps-bot-lib/-/ps-bot-lib-1.0.3.tgz","fileCount":15,"integrity":"sha512-kGJiJd6LcfeNEFnf/9/Q9ABqKkkzTpY3Q1UeOlHpC+MEjoTCeUhU0S1F03kMmpE7X64SgF9HtZXeTp5nHzCElQ==","signatures":[{"sig":"MEYCIQCHtl0i2TsrdddAbq7DLmxiQdATU+9KM/CBlaRHn6uLQAIhAL+2UyUSwZdT5kfnQyYlbxRoM8lc8oq1bdco+jDzkvNm","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":48589},"main":"dist/index.js","engines":{"node":">= 18.0.0"},"gitHead":"4ef4a7b187239839d438ac848158c4dfcf2dbb6c","scripts":{"lint":"eslint --fix src/**/*.ts","test":"env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha --bail -r ts-node/register 'tests/**/*.ts'","build":"rimraf dist && npm run compile","gendoc":"typedoc --out docs ./src","compile":"tsc --pretty --declaration","prebuild":"npm run lint"},"typings":"dist/index.d.ts","_npmUser":{"name":"asanrom","email":"agustinsanromanguzman@gmail.com"},"pre-commit":["lint"],"repository":{"url":"git+https://github.com/AgustinSRG/ps-bot-lib.git","type":"git"},"_npmVersion":"11.4.1","description":"Simple library to create bots for Pokemon Showdown","directories":{},"_nodeVersion":"20.19.1","dependencies":{"sockjs-client":"1.6.1"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"11.1.0","eslint":"8.37.0","rimraf":"4.4.1","ts-node":"10.9.1","typedoc":"0.24.6","typescript":"5.0.3","@types/node":"18.15.11","@types/mocha":"10.0.1","@types/sockjs-client":"1.5.1","@typescript-eslint/parser":"5.57.1","@typescript-eslint/eslint-plugin":"5.57.1"},"_npmOperationalInternal":{"tmp":"tmp/ps-bot-lib_1.0.3_1752934519694_0.9654077698917434","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@asanrom/ps-bot-lib","version":"2.0.0","author":{"url":"https://github.com/AgustinSRG","name":"Agustin San Roman","email":"agustinsanromanguzman@gmail.com"},"license":"MIT","_id":"@asanrom/ps-bot-lib@2.0.0","maintainers":[{"name":"asanrom","email":"agustinsanromanguzman@gmail.com"}],"homepage":"https://github.com/AgustinSRG/ps-bot-lib","bugs":{"url":"https://github.com/AgustinSRG/ps-bot-lib/issues"},"dist":{"shasum":"61d3f08953375f114a71b705390e5c1b031925d7","tarball":"https://registry.npmjs.org/@asanrom/ps-bot-lib/-/ps-bot-lib-2.0.0.tgz","fileCount":15,"integrity":"sha512-L2heNseKdSUOhX/90HqhH9QRg0Jhk/OLI6+1XQOXlVFkZ7l3pWyMeUSwU4YWcnjWK8nxboGPd63IIaShIEIbOA==","signatures":[{"sig":"MEUCIAbk8Kvt8WUSBrvifCOYR+ViUO2TMfwZSVcNP6Z2mQJ/AiEAjeSrRsN13VHAnVkB/JGSBdYey9mPpHh1rBPTLiNBWl0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":50180},"main":"dist/index.js","engines":{"node":">= 18.0.0"},"gitHead":"3b7a14440fc943714dbf1577badc69be5f78edb9","scripts":{"lint":"eslint --fix src/**/*.ts","test":"env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha --bail -r ts-node/register 'tests/**/*.ts'","build":"rimraf dist && npm run compile","gendoc":"typedoc --out docs ./src","compile":"tsc --pretty --declaration","prebuild":"npm run lint"},"typings":"dist/index.d.ts","_npmUser":{"name":"asanrom","email":"agustinsanromanguzman@gmail.com"},"overrides":{"serialize-javascript":"7.0.5"},"pre-commit":["lint"],"repository":{"url":"git+https://github.com/AgustinSRG/ps-bot-lib.git","type":"git"},"_npmVersion":"11.11.0","description":"Simple library to create bots for Pokemon Showdown","directories":{},"_nodeVersion":"22.21.1","dependencies":{"sockjs-client":"1.6.1"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"11.1.0","eslint":"8.37.0","rimraf":"4.4.1","ts-node":"10.9.1","typedoc":"0.24.6","typescript":"5.0.3","@types/node":"20.8.2","@types/mocha":"10.0.1","@types/sockjs-client":"1.5.1","@typescript-eslint/parser":"5.57.1","@typescript-eslint/eslint-plugin":"5.57.1"},"_npmOperationalInternal":{"tmp":"tmp/ps-bot-lib_2.0.0_1785582540459_0.33398103083861663","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"@asanrom/ps-bot-lib","version":"2.0.1","description":"Simple library to create bots for Pokemon Showdown","main":"dist/index.js","typings":"dist/index.d.ts","homepage":"https://github.com/AgustinSRG/ps-bot-lib","repository":{"type":"git","url":"git+https://github.com/AgustinSRG/ps-bot-lib.git"},"scripts":{"prebuild":"npm run lint","compile":"tsc --pretty --declaration","build":"rimraf dist && npm run compile","lint":"eslint --fix src/**/*.ts","test":"env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha --bail -r ts-node/register 'tests/**/*.ts'","gendoc":"typedoc --out docs ./src"},"author":{"name":"Agustin San Roman","email":"agustinsanromanguzman@gmail.com","url":"https://github.com/AgustinSRG"},"engines":{"node":">= 18.0.0"},"pre-commit":["lint"],"devDependencies":{"@types/mocha":"10.0.1","@types/node":"20.8.2","@types/sockjs-client":"1.5.1","@typescript-eslint/eslint-plugin":"5.57.1","@typescript-eslint/parser":"5.57.1","eslint":"8.37.0","mocha":"11.1.0","rimraf":"4.4.1","ts-node":"10.9.1","typedoc":"0.24.6","typescript":"5.0.3"},"license":"MIT","dependencies":{"sockjs-client":"1.6.1"},"overrides":{"serialize-javascript":"7.0.5"},"gitHead":"0a9bc596c68a7a7eaf4576eed5ea6947ba19e4f0","_id":"@asanrom/ps-bot-lib@2.0.1","bugs":{"url":"https://github.com/AgustinSRG/ps-bot-lib/issues"},"_nodeVersion":"22.21.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-wLRLRrhmXbR5WPqo/HIF9cJkTHRZFaxAQjj5eR+t3Rzsiy0dlEkbLqxl7Sw0748K10BzoQKL0PrAJcuITmEyPg==","shasum":"c59e6e9ccade4cd497b8057d84c3e3b864af6d44","tarball":"https://registry.npmjs.org/@asanrom/ps-bot-lib/-/ps-bot-lib-2.0.1.tgz","fileCount":15,"unpackedSize":50180,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIA2VRuzR3+IQ3rvzGSjM3zizO6uCurBRYFC3tdNv6rbzAiAe1ljas8Jjh9YgZKjCgN4q8mqjRBboxFV2E8DOD7/m+g=="}]},"_npmUser":{"name":"asanrom","email":"agustinsanromanguzman@gmail.com"},"directories":{},"maintainers":[{"name":"asanrom","email":"agustinsanromanguzman@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ps-bot-lib_2.0.1_1785583477353_0.5348397439735739"},"_hasShrinkwrap":false}},"time":{"created":"2023-08-26T13:02:22.068Z","modified":"2026-08-01T11:24:37.684Z","1.0.0":"2023-08-26T13:02:22.322Z","1.0.1":"2024-04-24T16:04:12.280Z","1.0.2":"2025-02-15T10:58:29.131Z","1.0.3":"2025-07-19T14:15:19.863Z","2.0.0":"2026-08-01T11:09:00.677Z","2.0.1":"2026-08-01T11:24:37.510Z"},"bugs":{"url":"https://github.com/AgustinSRG/ps-bot-lib/issues"},"author":{"name":"Agustin San Roman","email":"agustinsanromanguzman@gmail.com","url":"https://github.com/AgustinSRG"},"license":"MIT","homepage":"https://github.com/AgustinSRG/ps-bot-lib","repository":{"type":"git","url":"git+https://github.com/AgustinSRG/ps-bot-lib.git"},"description":"Simple library to create bots for Pokemon Showdown","maintainers":[{"name":"asanrom","email":"agustinsanromanguzman@gmail.com"}],"readme":"# Pokemon Showdown bot library\n\n[![npm version](https://badge.fury.io/js/%40asanrom%2Fps-bot-lib.svg)](https://badge.fury.io/js/%40asanrom%2Fps-bot-lib)\n[![Node.js CI](https://github.com/AgustinSRG/ps-bot-lib/actions/workflows/node.js.yml/badge.svg)](https://github.com/AgustinSRG/ps-bot-lib/actions/workflows/node.js.yml)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/AgustinSRG/ps-bot-lib/blob/master/LICENSE)\n\nSimple library to create bots for [Pokemon Showdown](https://github.com/smogon/pokemon-showdown), coded in typescript, for NodeJS.\n\n## Installation\n\nIn order to install the library to use for your project, run the following command:\n\n```sh\nnpm install --save @asanrom/ps-bot-lib\n```\n\n## Usage\n\nYou can use the library to instantiate Pokemon Showdown bots, controlling their actions and listening for events.\n\nExample code:\n\n```ts\nimport { PokemonShowdownBot } from \"@asanrom/ps-bot-lib\";\n\nconst bot = new PokemonShowdownBot({\n    // Configuration\n    host: \"sim3.psim.us\",\n    port: 443,\n    secure: true,\n    serverId: \"showdown\",\n});\n\nbot.on(\"error\", err => {\n    // When an error happens, the bot will emit the 'error' event\n    // Make sure to handle it, or otherwise the process will exit\n    console.error(err);\n});\n\nbot.on(\"connecting\", () => {\n    console.log(\"Bot connecting to the server...\");\n});\n\nbot.on(\"connected\", () => {\n    console.log(\"Bot connected!\");\n});\n\nbot.on(\"disconnected\", () => {\n    // If the bot disconnects, it will retry connecting to the server\n    // after 10s by default, you can change it in the configuration\n    console.log(\"Bot disconnected!\");\n});\n\nbot.on(\"can-login\", () => {\n    // Listen for this event to be able to log into an account\n    bot.rename(\"Example account\", \"eXampl3Pa5w0rd\");\n});\n\nbot.on(\"rename-failure\", err => {\n    // Could not log in (maybe invalid password?)\n    console.log(\"Could not log in. Error: \" + err.message);\n});\n\nbot.on(\"renamed\", nick => {\n    // This event indicates you bot successfully logged in\n    console.log(\"Renamed: \" + nick);\n\n    // Now you can send commands\n    bot.sendToGlobal(\"/join Example Room\");\n    bot.pm(\"Example User\", \"Hello!\");\n});\n\nbot.on(\"line\", (room, line, spl, isInitialMessage) => {\n    // This event is emitted when the bot receives a message line form the server\n    // room is the room identifier the line was received from, an empty string means is a global message\n    // line is the raw line received\n    // spl is the line splitted by the | character\n    // isInitialMessage is true if the line was received in the room initializing message, meaning it may be an old message\n    console.log(`Received message from room: ${room}, line: ${line}`);\n});\n\nbot.on(\"sent\", msg => {\n    // This event is emitted when the bot sends a message to the server\n    console.log(\"Sent message: \" + msg);\n});\n\nbot.connect();\n```\n\n## Documentation\n\nCheck the [documentation](./DOCUMENTATION.md) for detailed specifications for configuration, methods and events available.\n\nYou can also check the [auto generated documentation](https://agustinsrg.github.io/ps-bot-lib/).\n\n## Building\n\nIn order to build this library, you need:\n\n - [NodeJS](https://nodejs.org/en), latest stable version.\n\nRun the following command to install dependencies:\n\n```sh\nnpm install\n```\n\nRun the following command to build the typescript into javascript:\n\n```sh\nnpm run build\n```\n","readmeFilename":"README.md"}