AssisRaphael / fahelobot

NodeJS Whatsapp Bot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

culioBOT

Projeto original (Eliabot): https://github.com/eliabefranca/eliabot

O que é

Um bot para whatspapp feito com @open-wa/wa-automate

Funcionalidades

Além do automatizador para o Whatsapp, o projeto tem:

  • Uma sistema de armazenamento em JSON
  • Um painel simples feito em ReactJS
  • Uma API em NodeJS com Express

Instalando dependências

  yarn install &&
  cd src/panel &&
  yarn install &&
  cd ../..  

Rodando

Para executar o bot:

  yarn dev:bot

Para executar a api:

  yarn dev:api

Para executar o painel:

  yarn dev:panel

Adicionando comandos novos

Os comandos ficam na pasta src/bot/commands/command-list.

Não é necessário incluir o comando em nenhum lugar. Ao criá-lo ele será automaticamente importado usando o fast-glob.

Exemplo de um comando

import { Command, CommandData } from '../protocols/command';

const func: Command = async ({client, message}) => {
  await client.sendText(message.from, 'hello world');
};

const sampleCommand: CommandData = {
  command: '.hello', // o quê o usuário precisará digitar
  description: 'Printa "hello world"', // descrição, isso printa no comando ajuda
  func, // função que o comando executa
};

export default sampleCommand;

Testando

Este projeto não possui muitos testes 😥

Rodando os testes unitários

  yarn test:unit

About

NodeJS Whatsapp Bot

License:MIT License


Languages

Language:TypeScript 63.2%Language:JavaScript 36.4%Language:HTML 0.3%Language:CSS 0.0%