Coder Social home page Coder Social logo

fuwajs / fuwa.js Goto Github PK

View Code? Open in Web Editor NEW
11.0 2.0 0.0 28.94 MB

The new way to create Discord bots.

Home Page: https://fuwajs.github.io/

License: MIT License

TypeScript 99.41% JavaScript 0.59%
discord bot bot-application discordapp discordbot nodejs javascript discord-js discord-bot discord-api

fuwa.js's Introduction

The new, simple, and easy way to create progressive Discord bots.

Notice

Refactoring on branch @next

This branch will be depreaded soon...

Table of Contents

Features

  • โ˜•๏ธ | Express-like syntax
  • ๐Ÿ“ฆ | Lightweight (only two dependencies)*
  • ๐Ÿ”จ | Built-In Command Handler & Parser
  • ๐ŸŒŽ | Safe (complete runtime safety for your bot.)
  • โšก๏ธ | Blazing Fast
  • ๐Ÿ“‚ | Customizable Cache

* Excluding Peer (and of course) development dependencies

Quickstart

This assumes you have already setup a discord bot application in Discord. See

๐Ÿ“ - Create a new Nodejs project

Run this in your Powershell, command prompt, terminal, console or whatever you call it:

$ npm init -y

๐Ÿ“ฆ - Installing Fuwa.js

$ npm i fuwa.js

The Full version for increased speed (better for production)

$ npm i fuwa.js erlpack utf-8-validate bufferutil

* Note: you need python installed & a C++ compiler on your computer, server, or VM before you can use erlpack. To learn more, please visit node-gyp

Coding your bot

Create a file called index.js using the method bellow, or your method of choice for creating files

$ echo > index.js

Open index.js in your IDE or text editor of choice and copypaste this code

const { Client } = require('fuwa.js');

const client = new Client('?'); // Your bot prefix here

// Runs when the bot turns on
client.on('ready', () => console.log('I am alive!'));

client.command(['hi', 'hello'], (req, res) => {
    res.reply(`Hello there, my name is ${client.bot.username}!`);
});

// replace with your bot token
client.login('<your bot token>');

Make sure to replace <your bot token> with your actual bot token!

๐Ÿงช - Test it out

Run your bot using

$ node index.js

and add your bot to a discord server and type ?hi or ?hello in any visible channel. It should respond with Hello there, my name is <bot name>!

Useful links

Check the docs for reference. For more in depth docs go to our website!

Follow the tutorial for a ground up approach.

Join our discord to interact with our community and ask questions!

If you find any bugs please post them to our issues and we'll respond ASAP.

fuwa.js's People

Contributors

artrix9095 avatar codacy-badger avatar dependabot[bot] avatar dosu0 avatar notadevps avatar thatguyjamal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

fuwa.js's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.