discord.js-noobs
v1.0.0-fix
Published
This is noobs 初心者用フレームワーク
Readme
discord.js-noobs
Install
npm i discord.js-noobsClient
create new Client
const { Client } = require("discord.js-noobs");
const client = new Client({
prefix: ["!"],
readyMessage: (client) => `User : ${client.users.cache.size}`,
token: "your token",
});add command
//Simple command
client.command("ping", (msg) => {
msg.reply("pong!");
});
//add options
client.command(
"hello",
(msg, args) => {
msg.reply(`hello ${args.join(" ")}`);
},
{
practicable: ["user id"],
}
);load command
//index.js
client.commandDir("./command");
//command/ping.js
const { Command } = require("discord.js-noobs");
module.exports = new Command("ping").run((msg) => {
msg.reply("pong!");
});NoobsEmbed
const { Client, NoobsEmbed } = require("discord.js-noobs");
const client = new Client({
prefix: ["!"],
token: "your token",
});
//Simple embed
client.command("help", (msg) => {
msg.channel.send(
new NoobsEmbed()
.setTitle("title")
.addField("name", "value")
.setColor("RANDOM")
.setTimestamp()
);
});
//Pagination
client.command("help", (msg) => {
new NoobsEmbed({
type: "book",
client: client,
}).addPages([
new NoobsEmbed().setTitle("1/2").addField("help", "open help"),
new NoobsEmbed().setTitle("2/2").addField("ping", "pong"),
]);
});
