0.0.5 • Published 2 years ago
sercord v0.0.5
Sercord
Sercord 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('sercord');
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);
Collaborators
0.0.5
2 years ago