# discord-trolling

> A discord library simplifying discord.js

Latest version **1.4.2** (published 2022-03-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install discord-trolling
pnpm add discord-trolling
yarn add discord-trolling
bun add discord-trolling
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.2 |
| Published | 2022-03-09 |
| First published | 2021-09-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 27.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | ferretcode |
| Maintainers | ferretcode |
| Keywords | discord, discord.js, wrapper |

## Links

- npm: https://www.npmjs.com/package/discord-trolling
- Repository: https://github.com/ferretcode/discord-trolling
- Homepage: https://github.com/ferretcode/discord-trolling#readme
- Issues: https://github.com/ferretcode/discord-trolling/issues
- npm.io page: https://npm.io/package/discord-trolling

## Dependencies (4)

- [chalk](https://npm.io/package/chalk.md) ^4.1.2
- [discord.js](https://npm.io/package/discord.js.md) ^13.1.0
- [@discordjs/rest](https://npm.io/package/@discordjs/rest.md) ^0.1.0-canary.0
- [discord-api-types](https://npm.io/package/discord-api-types.md) ^0.22.0

## Recent versions

- 1.4.2 (latest) — 2022-03-09
- 1.4.1 — 2022-02-19
- 1.4.0 — 2022-02-01
- 1.3.9 — 2022-02-01
- 1.3.8 — 2022-02-01
- 1.3.7 — 2022-02-01
- 1.3.6 — 2022-02-01
- 1.3.5 — 2022-02-01
- 1.3.4 — 2022-01-30
- 1.3.3 — 2022-01-22
- 1.3.2 — 2022-01-05
- 1.3.1 — 2022-01-05
- 1.3.0 — 2021-12-25
- 1.2.9 — 2021-12-23
- 1.2.8 — 2021-12-23
- … 28 more at https://npm.io/package/discord-trolling/versions

## README

# discord-trolling 👏

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

[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/J3J54IL17)

[![npm version](https://badge.fury.io/js/discord-trolling.svg)](https://badge.fury.io/js/discord-trolling)

<a href="https://gifyu.com/image/SSDPY"><img src="https://s10.gifyu.com/images/Peek-2022-01-04-17-04ab7aa7acdce6b994.gif" alt="Peek-2022-01-04-17-04ab7aa7acdce6b994.gif" border="0" height="500" width="600" /></a>

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 💌

- [JiggsFld who helped me test in a production environment](https://github.com/JiggsFld)

# 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:

```javascript
//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

```javascript
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.

---
_Source: https://npm.io/package/discord-trolling · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
