Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
discord-trolling
Advanced tools
An easy to use discord.js wrapper for people who want to make Discord bots quickly
Create a new discord-trolling project:
npx create-discord-trolling-app
Read the docs:
https://ferretcode.gitbook.io/discord-trolling/
To get started, you can run: npx create-discord-trolling-app
, (recommended)
OR
npm install discord-trolling
//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");
const { Troll } = require("discord-trolling");
module.exports.ping = class extends Troll {
constructor(interaction, client) {
super(interaction, client);
this.run = () => {
this.interaction.reply("pong!");
};
}
};
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.
Contributions are always welcome and great to see!
If you are adding a new class, please follow the UpperCamelCase naming convention.
FAQs
A discord library simplifying discord.js
The npm package discord-trolling receives a total of 0 weekly downloads. As such, discord-trolling popularity was classified as not popular.
We found that discord-trolling demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.