Git Product home page Git Product logo

discord-trolling 👏

An easy to use discord.js wrapper for people who want to make Discord bots quickly

ko-fi

npm version

Peek-2022-01-04-17-04ab7aa7acdce6b994.gif

Create a new discord-trolling project:

npx create-discord-trolling-app

Read the docs:

https://ferretcode.gitbook.io/discord-trolling/

Features 📄

  • Easy to use, familiar API
  • Fast to develop with
  • Built in, easy command structuring
  • Simple command registration
  • Automatic project generator
  • Custom CLI
  • Documentation
  • Simple plugin management
  • Large & growing ecosystem of tools
  • troll funni

Acknowledgements 💌

Roadmap 🛣️

  • Big Features

    • CLI Daemonization
    • Custom templates
    • Built-in HTTP or Webhook requests for logging
    • Full documentation
    • Voice wrapper
    • Embed maker
    • Custom modal implementation
    • Plugin management
    • Built-in command handler
  • Low priority

    • QOL features
    • Improved tests
  • Not confirmed

    • Write Discord API wrapper from scratch
    • Desktop app

Quickstart 💨

To get started, you can run: npx create-discord-trolling-app, (recommended) Then, visit the documentation at https://ferretcode.gitbook.io/discord-trolling/

OR (unrecommended)

  • Run npm install discord-trolling
  • Create index.js
  • Paste these contents inside:
//import components from the library
const {
  Client,
  Intents,
  Manager,
  Command,
  OptionTypes,
} = require("discord-trolling");

//recommended format for creating command structures
let command = () => {
  //create command
  let ping = new Command();

  ping.setName("ping");
  ping.setDescription("ping");

  let option = ping.createOption();

  option.setName("ping");
  option.setRequired(true);
  option.setType(OptionTypes.STRING); //you can also do "option.types.STRING"
  option.setDescription("ping");
  option.setValue("ping");

  ping.finalizeOption(option);

  //finalize command structure
  return ping.troll();
};

//register command
//you can omit guildId if isGuildCommand is set to false
Manager.registerCommands([command()], {
  token: "your bot token",
  clientId: "your bot id",
  guildId: "your guild id",
  isGuildCommand: true,
}).catch((err) => console.error(err));

//create client
let bot = new Client({ intents: [Intents.FLAGS.GUILDS] });

//listen for a command
bot.on("interactionCreate", (interaction) => {
  if (interaction.commandName === "pong") interaction.reply("pong");
});

//login (trollface)
bot.troll("your bot token");
  • Create a new file at commands/ping.js
const { Troll } = require("discord-trolling");

module.exports.ping = class extends Troll {
  constructor(interaction, client) {
    super(interaction, client);

    this.run = () => {
      this.interaction.reply("pong!");
    };
  }
};

Running Tests 🧐

New tests coming soon

Contributing 💻

Contributions are always welcome and great to see!

You can either:

If you are adding a new class, please follow the UpperCamelCase naming convention.

discord-trolling's Projects

discord-trolling icon discord-trolling

A library to make creating discord bots easier that is built on discord.js

plugins icon plugins

Public plugins repository for discord-trolling

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.