Skip to content

nev-r/now-answer-me

Repository files navigation

now-answer-me

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");

image


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!";
}

image


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);
}

image


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' }
);

image image

About

i showed you my bot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published