consolebot is a wrapper for creating console bots and is easy which only has 3 steps!
Get started by installing the wrapper: npm install consolebot@latest
!
Example code:
const cb = require('consolebot');
cb.createBot({
name: 'TEST-BOT',
id: '<optional>'
});
Functions
chat
The chat function is used to let the bot chat in the console!
cb.chat('<message>');
updateName
The updateName function is used to change the name of the bot.
cb.updateName('TEST-BOT-2');
getId
The getId function is used to get the id of the bot.
If the id is '' in the { id } value of the createBot function then the output will show 'Not specified'
cb.getId();
cb.getId();
getName
The getName function is used to get the name of the bot.
cb.getName();
We don't think if the updateName function counts but we will experiment it:
cb.updateName('TEST-BOT-2');
cb.getName();
Update
UPDATE (9/18/2022 4:59 PM): Updated to throw an error if the name option is undefined
UPDATE (9/19/2022 11:11 AM): Made a new function 'getId' and 'getName'!