1.4.2 • Published 2 years ago

discord-trolling v1.4.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

discord-trolling 👏

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

ko-fi

npm version

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
  • troll funni

Acknowledgements 💌

Roadmap 🛣️

  • Big Features

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

    • QOL features
    • Improved tests
  • Not confirmed

    • Write Discord API wrapper from scratch

Quickstart 💨

To get started, you can run: npx create-discord-trolling-app, (recommended)

OR

  • 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 🧐

To verify that the library is working, please open test.js and replace the "your bot token", "your bot id" and "your guild id" fields with the respective information, and run the file.

Contributing 💻

Contributions are always welcome and great to see!

You can either:

  • Create your contribution, make a PR and hope a maintainer sees it.
  • Or join the Discord server at https://discord.gg/cvx9WS7V and propose an idea to me or a maintainer or tell us about a PR you made.

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

1.4.2

2 years ago

1.2.0

2 years ago

1.3.7

2 years ago

1.2.8

2 years ago

1.1.9

2 years ago

1.3.6

2 years ago

1.2.7

2 years ago

1.1.8

2 years ago

1.3.5

2 years ago

1.2.6

2 years ago

1.3.4

2 years ago

1.2.5

2 years ago

1.3.3

2 years ago

1.2.4

2 years ago

1.4.1

2 years ago

1.3.2

2 years ago

1.2.3

2 years ago

1.4.0

2 years ago

1.3.1

2 years ago

1.2.2

2 years ago

1.3.0

2 years ago

1.2.1

2 years ago

1.3.9

2 years ago

1.3.8

2 years ago

1.2.9

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.9

2 years ago

1.1.7

2 years ago

1.0.8

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago