replchat.js
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -10,3 +10,3 @@ const io = require("socket.io-client"); | ||
this.username = username | ||
// this.username = username | ||
this.beta = beta | ||
@@ -13,0 +13,0 @@ } |
{ | ||
"name": "replchat.js", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A library for making bots with replchat (https://replchat.vapwastaken.repl.co/)", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,2 +0,56 @@ | ||
# replchat.js | ||
A blazingly fast library for making replchat bots | ||
# About | ||
replchat.js is a blazingly fast library for making replchat bots that is Object-oriented | ||
# Installation | ||
npm install replchat.js | ||
# Examples | ||
You will need to get an auth token for your bot however, in the future there may be a better method | ||
Basic Bot: | ||
``` | ||
const ReplBot = require('replbot.js') | ||
const bot = new ReplBot() | ||
bot.on('ready', () => { | ||
console.log('Bot is logged in!') | ||
}) | ||
bot.login('your-auth-token') | ||
``` | ||
After this we can add a simpl command system: | ||
``` | ||
const ReplBot = require('replbot.js') | ||
const bot = new ReplBot() | ||
const config = { | ||
prefix: '!' | ||
} | ||
const commands = [ | ||
'ping' | ||
] | ||
bot.on('ready', () => { | ||
console.log('Bot is logged in!') | ||
}) | ||
bot.on('message', (message) => { | ||
if (!message.content.startsWith(config.prefix)) return; | ||
var fullCommand = message.content.substr(config.prefix.length).split(" ") | ||
var command = fullCommand[0] | ||
var args = fullCommand.splice(0, 1) | ||
if (commands.includes(command)) { | ||
if (command === 'ping') | ||
bot.send('pong!') | ||
} else | ||
bot.send(`Invalid Command! Use \`${config.prefix}help\` for a list of valid commands!`) | ||
}) | ||
bot.login('your-auth-token') | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4312
56