the goal is to make a simple discord bot possible in about
as much time as it takes to type npm install nev-r/now-answer-me
import { addCommand, init } from "now-answer-me";
addCommand({ command: "hello", response: 'hi!' });
init("smIcXn83zPK.MY.DISCORD.API.TOKEN.l898HA5E");
instead of a string, command
can be multiple strings which will activate the same command
instead of a string, response
can be a function which returns a response
addCommand({ command: ["echo", "echothis"], response: echoSomething });
function echoSomething({args}) {
if (args) return args;
else return "you didn't give me anything to repeat!";
}
a response
function receives data about the trigger. for the power user, instead of returning a value,
and the code can just deal with the discord.js Message
object directly
addCommand({ command: "tattle", response: tattleOnUser });
function tattleOnUser({msg, args, command, content}) {
const text = `i was sent "${args}" by ${msg.author}!`;
msg.channel.send(text);
}
set your command prefix, and a set up status message
import { setPrefix } from "now-answer-me";
setPrefix('&&&&&');
addActivity(
{ name: 'in the fall leaves 🍃', type: 'PLAYING' }
);