0.0.4 • Published 8 months ago
wumpcli v0.0.4
WumpCli
WumpCli is a customized Discord.JS API that uses a more service-based approach to creating discord bots similar to how Roblox Studio uses services
const { Client } = require('wumpcli');
const client = new Client(/* stuff */);
client.on("ready", (ctx) => {
console.log(`logged in as ${ctx.user.username}`);
});
new client.EventService; // imports the event service for creating events
let cmd = new client.CommandService; // imports the command service for creating slash commands
let channels = new client.ChannelService; // imports the channel service
let event = new Event();
client.events.push("pingCmd", event);
client.on("pingCmd", async (ctx) => {
let channel = await channels.get("channel id");
channel.send(`ping command ran by ${ctx.author} in guild ${ctx.guild.name} (${ctx.guild.id})`);
});
cmd.create("ping", "replies with pong", (ctx) => {
ctx.reply("pong!");
event.fire(ctx);
});
client.login(token);